diff options
author | elioat <elioat@tilde.institute> | 2024-12-24 14:43:49 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2024-12-24 14:43:49 -0500 |
commit | b08a7074b84223fc92d3a24b7758cf222f3f97ef (patch) | |
tree | 0ff8f237828241443665f302c4a3b03e9bfccb09 /html/rogue/js/rogue.js | |
parent | 57929fc1a92493cee0de00a079fb22d003a348e3 (diff) | |
download | tour-b08a7074b84223fc92d3a24b7758cf222f3f97ef.tar.gz |
*
Diffstat (limited to 'html/rogue/js/rogue.js')
-rw-r--r-- | html/rogue/js/rogue.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/html/rogue/js/rogue.js b/html/rogue/js/rogue.js index 8276d8d..f441bbd 100644 --- a/html/rogue/js/rogue.js +++ b/html/rogue/js/rogue.js @@ -72,6 +72,10 @@ const render = (ctx, state) => { state.world.backgroundRocks.forEach(rock => { renderRock(ctx, rock, ctx.canvas.height - state.world.groundHeight); }); + + state.world.backgroundGrass.forEach(grass => { + renderGrass(ctx, grass, ctx.canvas.height - state.world.groundHeight, state.time); + }); // 2. Render platforms state.world.platforms.forEach(platform => { @@ -91,6 +95,10 @@ const render = (ctx, state) => { renderRock(ctx, rock, ctx.canvas.height - state.world.groundHeight); }); + state.world.foregroundGrass.forEach(grass => { + renderGrass(ctx, grass, ctx.canvas.height - state.world.groundHeight, state.time); + }); + // 5. Render ground const groundY = ctx.canvas.height - state.world.groundHeight; ctx.fillStyle = '#4a4'; |