parent
becd305e01
commit
5cc96cbdba
10 changed files with 53 additions and 21 deletions
|
@ -2,11 +2,16 @@ module RPGEngine.Input.Lose
|
|||
( handleInputLose
|
||||
) where
|
||||
|
||||
import RPGEngine.Input.Core (InputHandler)
|
||||
import RPGEngine.Input.Core (InputHandler, handleAnyKey)
|
||||
|
||||
import RPGEngine.Data (Game)
|
||||
import RPGEngine.Data (Game(..), State(..))
|
||||
|
||||
------------------------------ Exported ------------------------------
|
||||
|
||||
handleInputLose :: InputHandler Game
|
||||
handleInputLose = undefined
|
||||
handleInputLose = handleAnyKey retry
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
retry :: Game -> Game
|
||||
retry g@Game{ state = Lose{ restart = restart }} = g{ state = restart }
|
|
@ -50,7 +50,7 @@ checkPlaying g@Game{ state = s@Playing{ restart = restart }} = newGame
|
|||
where newGame | isPlayerDead g = loseGame
|
||||
| isPlayerAtExit g = g{ state = goToNextLevel s }
|
||||
| otherwise = g
|
||||
loseGame = g{ state = restart }
|
||||
loseGame = g{ state = Lose{ restart = restart }}
|
||||
checkPlaying g = g
|
||||
|
||||
pauseGame :: Game -> Game
|
||||
|
|
Reference in a new issue