aboutsummaryrefslogtreecommitdiff
path: root/src/Game/Entities.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-02-26 00:28:00 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-02-26 00:28:00 +0000
commit9efd5381a31d69a1122f101cbee03ad3a91ed4b3 (patch)
tree8330b3bc388175f7644ee6ca2cb1816d89e875df /src/Game/Entities.hs
parent9b04633e09a80d33456f545baf1fa910f0986db7 (diff)
downloadspace-plat-hs-9efd5381a31d69a1122f101cbee03ad3a91ed4b3.tar.gz
space-plat-hs-9efd5381a31d69a1122f101cbee03ad3a91ed4b3.zip
Set the frame to 0
The "Dying" set has only one frame.
Diffstat (limited to 'src/Game/Entities.hs')
-rw-r--r--src/Game/Entities.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Game/Entities.hs b/src/Game/Entities.hs
index a168e83..7e0e0cf 100644
--- a/src/Game/Entities.hs
+++ b/src/Game/Entities.hs
@@ -54,7 +54,7 @@ updateAll es = do
-- is the player dead?
updated' <- do
s <- readIORef es.state
- pure $ if s.lives == 0 && updatedPlayer.dir /= Dying then (head updated) {dir = Dying, gravity = gravityUp} : tail updated else updated
+ pure $ if s.lives == 0 && updatedPlayer.dir /= Dying then (head updated) {dir = Dying, gravity = gravityUp, frame = 0} : tail updated else updated
-- clear spawns (new entities), filter out destroyed entities, and add the new ones
pure es {entities = map (\e -> e {spawns = []}) (filter (\e -> not e.destroy) updated') ++ new}
where