aboutsummaryrefslogtreecommitdiff
path: root/src/Game/Entities/Common.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-03-21 21:28:25 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-03-21 21:28:25 +0000
commit11d2ed7f15a86dd465bc3456e3478e9ff03bf5d2 (patch)
treef5e6df771eb4396df13fe3cdc2d98721917a2d68 /src/Game/Entities/Common.hs
parent1c8a22d24b14d258a9103f7b83d627359eae0da8 (diff)
downloadspace-plat-hs-11d2ed7f15a86dd465bc3456e3478e9ff03bf5d2.tar.gz
space-plat-hs-11d2ed7f15a86dd465bc3456e3478e9ff03bf5d2.zip
Introduce a set property
Stopped abusing the direction property!
Diffstat (limited to 'src/Game/Entities/Common.hs')
-rw-r--r--src/Game/Entities/Common.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Game/Entities/Common.hs b/src/Game/Entities/Common.hs
index 69786e5..82e790e 100644
--- a/src/Game/Entities/Common.hs
+++ b/src/Game/Entities/Common.hs
@@ -16,12 +16,10 @@ import qualified Game.Sprites as S
toSpriteSet :: Dir -> Int
toSpriteSet DirRight = 0
toSpriteSet DirLeft = 1
--- not really a direction
-toSpriteSet Dying = 2
-- | Return the number of frames available on the entity's sprite for current direction.
frameLimit :: Entity -> Int
-frameLimit e = S.frameCount e.sprite (toSpriteSet e.dir)
+frameLimit e = S.frameCount e.sprite e.set
-- | Collision detection of player vs entity.
--