draw player last so ripples are always on bottom

pull/10/head
Brian Picciano 3 years ago
parent 481d14784d
commit 78a5df1684
  1. 5
      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);

Loading…
Cancel
Save