From 11d2ed7f15a86dd465bc3456e3478e9ff03bf5d2 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 21 Mar 2023 21:28:25 +0000 Subject: Introduce a set property Stopped abusing the direction property! --- src/Game/Entities/Common.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Game/Entities/Common.hs') 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. -- -- cgit v1.2.3