(x, y)
| 130 | } |
| 131 | |
| 132 | function moveBallTo(x, y) { |
| 133 | const w = ball.width, h = ball.height; |
| 134 | |
| 135 | if ((Math.abs(ball.x - x) <= w) && (Math.abs(ball.y - y) <= h)) |
| 136 | render.begin(Math.min(ball.x, x), Math.min(ball.y, y), w << 1, h << 1); // often overdrawing |
| 137 | else { |
| 138 | render.begin(ball.x, ball.y, w, h); |
| 139 | render.fillRectangle(ball.backgroundColor, 0, 0, width, height); |
| 140 | render.continue(x, y, w, h); |
| 141 | } |
| 142 | |
| 143 | render.fillRectangle(ball.backgroundColor, 0, 0, width, height); |
| 144 | render.drawMasked(ball, x, y, 0, 0, w, h, ball.alpha, 0, 0); |
| 145 | render.end(); |
| 146 | |
| 147 | ball.x = x; |
| 148 | ball.y = y; |
| 149 | } |
no test coverage detected