diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/_posts/2021-03-12-ripple-a-game.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/_posts/2021-03-12-ripple-a-game.md b/src/_posts/2021-03-12-ripple-a-game.md index 6941262..16b13e7 100644 --- a/src/_posts/2021-03-12-ripple-a-game.md +++ b/src/_posts/2021-03-12-ripple-a-game.md @@ -283,10 +283,11 @@ function doTick() { } } + drops = drops.filter(drop => !drop.canGC()); + ctx.clearRect(0, 0, canvas.width, canvas.height); - player.draw() drops.forEach(drop => drop.draw()); - drops = drops.filter(drop => !drop.canGC()); + player.draw() if (gameState == 'play') currTick++; requestAnimationFrame(doTick); |