summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2021-03-12 18:08:30 -0700
committerBrian Picciano <mediocregopher@gmail.com>2021-03-12 18:08:30 -0700
commit78a5df1684f95fdf29b7f741376b9c9c7ec6f3b3 (patch)
tree95cc42b4abe12a56290b3b1088ced86a4934cf6d /src
parent481d14784d4497df6ce2a13d6f2aa9ade3953799 (diff)
draw player last so ripples are always on bottom
Diffstat (limited to 'src')
-rw-r--r--src/_posts/2021-03-12-ripple-a-game.md5
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);