diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-02-16 21:11:18 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-02-16 21:11:18 +0000 |
commit | 1d68ac340c28792b2b498e204ef123730d901443 (patch) | |
tree | 840514d136efbfe57b1f1321cc0b3d82286fb188 /src/Game.hs | |
parent | 11120a24b6927073d55d2e56b4b911817dedaae2 (diff) | |
download | space-plat-hs-1d68ac340c28792b2b498e204ef123730d901443.tar.gz space-plat-hs-1d68ac340c28792b2b498e204ef123730d901443.zip |
Added lives to the HUD
Diffstat (limited to 'src/Game.hs')
-rw-r--r-- | src/Game.hs | 7 |
1 files changed, 6 insertions, 1 deletions
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 |