#6 Win/End state #8 End screen #9 level selection

This commit is contained in:
Tibo De Peuter 2022-12-22 16:25:29 +01:00
parent becd305e01
commit 5cc96cbdba
10 changed files with 53 additions and 21 deletions

View file

@ -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