aboutsummaryrefslogtreecommitdiff
path: root/src/Game.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-02-16 21:11:18 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-02-16 21:11:18 +0000
commit1d68ac340c28792b2b498e204ef123730d901443 (patch)
tree840514d136efbfe57b1f1321cc0b3d82286fb188 /src/Game.hs
parent11120a24b6927073d55d2e56b4b911817dedaae2 (diff)
downloadspace-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.hs7
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