From 9efd5381a31d69a1122f101cbee03ad3a91ed4b3 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 26 Feb 2023 00:28:00 +0000 Subject: Set the frame to 0 The "Dying" set has only one frame. --- src/Game/Entities.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3