(distance)
| 74 | |
| 75 | |
| 76 | function _moveForward(distance){ |
| 77 | var start = position; |
| 78 | position = { |
| 79 | x: cos(direction) * distance * PIXEL_RATIO + start.x, |
| 80 | y: -sin(direction) * distance * PIXEL_RATIO + start.y |
| 81 | }; |
| 82 | if (pen){ |
| 83 | ctx.lineStyle = color; |
| 84 | ctx.beginPath(); |
| 85 | ctx.moveTo(start.x, start.y); |
| 86 | ctx.lineTo(position.x, position.y); |
| 87 | ctx.stroke(); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | function penUp(){ pen = false; } |
| 92 | function penDown(){ pen = true; } |
no outgoing calls
no test coverage detected