(x, y)
| 120 | } |
| 121 | |
| 122 | function moveBallTo(x, y) { |
| 123 | const w = ball.width, h = ball.height; |
| 124 | |
| 125 | if ((Math.abs(ball.x - x) <= w) && (Math.abs(ball.y - y) <= h)) |
| 126 | render.begin(Math.min(ball.x, x), Math.min(ball.y, y), w << 1, h << 1); // often overdrawing |
| 127 | else { |
| 128 | render.begin(ball.x, ball.y, w, h); |
| 129 | render.fillRectangle(ball.backgroundColor, 0, 0, width, height); |
| 130 | render.continue(x, y, w, h); |
| 131 | } |
| 132 | |
| 133 | render.fillRectangle(ball.backgroundColor, 0, 0, width, height); |
| 134 | render.drawMasked(ball, x, y, 0, 0, w, h, ball.alpha, 0, 0); |
| 135 | render.end(); |
| 136 | |
| 137 | ball.x = x; |
| 138 | ball.y = y; |
| 139 | } |
no test coverage detected