parent
becd305e01
commit
5cc96cbdba
10 changed files with 53 additions and 21 deletions
|
@ -5,7 +5,7 @@ module RPGEngine.Data.Game
|
|||
) where
|
||||
|
||||
import RPGEngine.Data
|
||||
( Player(Player, position),
|
||||
( Player(..),
|
||||
Direction,
|
||||
Physical(Exit, Walkable, Entrance),
|
||||
State(..),
|
||||
|
@ -33,4 +33,5 @@ isPlayerAtExit _ = False
|
|||
|
||||
-- Check if the players health is <= 0, which means the player is dead.
|
||||
isPlayerDead :: Game -> Bool
|
||||
isPlayerDead _ = False
|
||||
isPlayerDead g@Game{ state = Playing{ player = Player{ playerHp = (Just hp)}}} = hp <= 0
|
||||
isPlayerDead _ = False
|
||||
|
|
Reference in a new issue