(x, y)
| 153 | } |
| 154 | |
| 155 | function moveBallTo(x, y) { |
| 156 | const w = ball.width, h = ball.height; |
| 157 | |
| 158 | if ((Math.abs(ball.x - x) <= w) && (Math.abs(ball.y - y) <= h)) |
| 159 | render.begin(Math.min(ball.x, x), Math.min(ball.y, y), w << 1, h << 1); // often overdrawing |
| 160 | else { |
| 161 | render.begin(ball.x, ball.y, w, h); |
| 162 | render.fillRectangle(ball.backgroundColor, 0, 0, width, height); |
| 163 | render.continue(x, y, w, h); |
| 164 | } |
| 165 | |
| 166 | render.fillRectangle(ball.backgroundColor, 0, 0, width, height); |
| 167 | render.drawMasked(ball, x, y, 0, 0, w, h, ball.alpha, 0, 0); |
| 168 | render.end(); |
| 169 | |
| 170 | ball.x = x; |
| 171 | ball.y = y; |
| 172 | } |
no test coverage detected