From 645c988da93b92dcddda87a314f64cd1b5ae1cd7 Mon Sep 17 00:00:00 2001 From: elioat Date: Tue, 24 Dec 2024 15:58:33 -0500 Subject: * --- html/rogue/js/rogue.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'html/rogue/js/rogue.js') diff --git a/html/rogue/js/rogue.js b/html/rogue/js/rogue.js index 75a4c86..64716a4 100644 --- a/html/rogue/js/rogue.js +++ b/html/rogue/js/rogue.js @@ -22,10 +22,14 @@ const initGame = () => { window.addEventListener('resize', resizeCanvas); resizeCanvas(); + // Calculate initial player position at ground level + const groundY = canvas.height - CONFIG.world.groundHeight; + const initialPlayerY = groundY - CONFIG.player.height; + // Game state let gameState = { time: 0, - player: createPlayer(100, 100), + player: createPlayer(100, initialPlayerY), camera: createCamera(0, 0), world: createWorld(), debug: { -- cgit 1.4.1-2-gfad0