diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-03-05 14:55:25 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-03-09 12:21:05 +0000 |
commit | 7a714cc457323bff6b4a73ec9e7b58c7a63381ec (patch) | |
tree | 23305ab55b3c79fb6bb62c3df56baa01b28890fe /src/Game/Entities | |
parent | beecc1e2af08f81f5cb5d2ebb93aaef59b20fcd5 (diff) | |
download | space-plat-hs-7a714cc457323bff6b4a73ec9e7b58c7a63381ec.tar.gz space-plat-hs-7a714cc457323bff6b4a73ec9e7b58c7a63381ec.zip |
Exit placement on the last battery
Diffstat (limited to 'src/Game/Entities')
-rw-r--r-- | src/Game/Entities/Pickup.hs | 2 | ||||
-rw-r--r-- | src/Game/Entities/Types.hs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Game/Entities/Pickup.hs b/src/Game/Entities/Pickup.hs index 7c1937c..a933efc 100644 --- a/src/Game/Entities/Pickup.hs +++ b/src/Game/Entities/Pickup.hs @@ -27,7 +27,7 @@ mkBattery sprites x y playerCollision = do updateBattery :: Collision -> Entity -> IO Entity updateBattery touchedPlayer e = do touched <- touchedPlayer e - pure $ if touched then e {destroy = True, actions = [ActionAddBattery]} else updateBatteryFrame + pure $ if touched then e {destroy = True, actions = [ActionAddBattery e.x e.y]} else updateBatteryFrame where updateBatteryFrame :: Entity updateBatteryFrame diff --git a/src/Game/Entities/Types.hs b/src/Game/Entities/Types.hs index dce4ffa..64b4637 100644 --- a/src/Game/Entities/Types.hs +++ b/src/Game/Entities/Types.hs @@ -29,7 +29,7 @@ data Entities = Entities -- | The effect name must match the sprite name in the spritesheet. type EffectName = String -data Action = ActionAddEffect Int Int EffectName | ActionAddBattery | ActionHitPlayer +data Action = ActionAddEffect Int Int EffectName | ActionAddBattery Int Int | ActionHitPlayer data Entity = Entity { typ :: Type, |