diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-02-24 22:51:42 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-02-24 22:51:42 +0000 |
commit | e066422b950a06873efb6a884b47155c867b7acf (patch) | |
tree | 833c0ac83cdb66ec50f3ef882598d3b93004cf12 /src/Game/Entities/Pickup.hs | |
parent | cf01ddef562c64dbcffa2770f50825cd97f02e3f (diff) | |
download | space-plat-hs-e066422b950a06873efb6a884b47155c867b7acf.tar.gz space-plat-hs-e066422b950a06873efb6a884b47155c867b7acf.zip |
Cleaned passing the collision detection function to the entities
Diffstat (limited to 'src/Game/Entities/Pickup.hs')
-rw-r--r-- | src/Game/Entities/Pickup.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Game/Entities/Pickup.hs b/src/Game/Entities/Pickup.hs index 8d8beb8..4aa7326 100644 --- a/src/Game/Entities/Pickup.hs +++ b/src/Game/Entities/Pickup.hs @@ -1,13 +1,12 @@ module Game.Entities.Pickup (mkBattery) where -import Data.IORef import Game.Entities.Common import Game.Entities.Const import Game.Entities.Types import qualified Game.Sprites as S -mkBattery :: S.SpriteSheet -> Int -> Int -> IORef Entity -> IO () -> IO Entity -mkBattery sprites x y playerRef collectedBattery' = do +mkBattery :: S.SpriteSheet -> Int -> Int -> Collision -> IO () -> IO Entity +mkBattery sprites x y playerCollision collectedBattery' = do s <- S.get sprites "battery" pure Entity @@ -20,7 +19,7 @@ mkBattery sprites x y playerRef collectedBattery' = do gravity = gravityOff, dir = DirRight, sprite = s, - update = updateBattery (collision playerRef 16) collectedBattery', + update = updateBattery playerCollision collectedBattery', destroy = False, spawns = [] } |