This repository has been archived on 2023-06-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2022FuncProg-project3-RPGEn.../lib/RPGEngine/Input/Paused.hs

18 lines
No EOL
560 B
Haskell

module RPGEngine.Input.Paused
( handleInputPaused
) where
import RPGEngine.Input.Core (InputHandler, handleAnyKey)
import RPGEngine.Data (Game (..), State (continue, Paused))
------------------------------ Exported ------------------------------
handleInputPaused :: InputHandler Game
handleInputPaused = handleAnyKey continueGame
----------------------------------------------------------------------
continueGame :: Game -> Game
continueGame g@Game{ state = Paused{ continue = state }} = newGame
where newGame = g{ state = state }
continueGame g = g