From 1d68ac340c28792b2b498e204ef123730d901443 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 16 Feb 2023 21:11:18 +0000 Subject: Added lives to the HUD --- src/Game.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Game.hs') diff --git a/src/Game.hs b/src/Game.hs index a7454b8..bc604ad 100644 --- a/src/Game.hs +++ b/src/Game.hs @@ -26,6 +26,9 @@ gameWidth, gameHeight :: CInt gameScale :: CInt gameScale = 3 +maxLives :: Int +maxLives = 4 + windowWidth, windowHeight :: CInt (windowWidth, windowHeight) = (gameWidth * gameScale, gameHeight * gameScale) @@ -77,7 +80,9 @@ main = do newIORef GS.State { batteries = 0, - totalBatteries = M.totalBatteries map' + totalBatteries = M.totalBatteries map', + lives = maxLives, + totalLives = maxLives } hud <- H.mkHud sprites state entities <- newIORef =<< E.mkEntities sprites map' controls state -- cgit v1.2.3