(x, y)
| 107 | } |
| 108 | |
| 109 | function moveBallTo(x, y) { |
| 110 | const w = ball.width, h = ball.height; |
| 111 | |
| 112 | if ((Math.abs(ball.x - x) <= w) && (Math.abs(ball.y - y) <= h)) |
| 113 | render.begin(Math.min(ball.x, x), Math.min(ball.y, y), w << 1, h << 1); // often overdrawing |
| 114 | else { |
| 115 | render.begin(ball.x, ball.y, w, h); |
| 116 | render.fillRectangle(ball.backgroundColor, 0, 0, width, height); |
| 117 | render.continue(x, y, w, h); |
| 118 | } |
| 119 | |
| 120 | render.fillRectangle(ball.backgroundColor, 0, 0, width, height); |
| 121 | render.drawMasked(ball, x, y, 0, 0, w, h, ball.alpha, 0, 0); |
| 122 | render.end(); |
| 123 | |
| 124 | ball.x = x; |
| 125 | ball.y = y; |
| 126 | } |
no test coverage detected