#9 Added level selection render
This commit is contained in:
parent
0786a41006
commit
2055ef234e
17 changed files with 401 additions and 34 deletions
|
@ -15,8 +15,9 @@ import Graphics.Gloss.Interface.IO.Game
|
|||
|
||||
-- Handle all input for RPG-Engine
|
||||
handleAllInput :: InputHandler Game
|
||||
handleAllInput ev g@Game{ state = Playing } = handlePlayInputs ev g
|
||||
handleAllInput ev g = handleAnyKey setNextState ev g
|
||||
handleAllInput ev g@Game{ state = Playing } = handlePlayInputs ev g
|
||||
handleAllInput ev g@Game{ state = LvlSelect } = handleLvlSelectInput ev g
|
||||
handleAllInput ev g = handleAnyKey setNextState ev g
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
@ -38,6 +39,10 @@ handlePlayInputs = composeInputHandlers [
|
|||
handleKey (Char 'a') $ movePlayer West
|
||||
]
|
||||
|
||||
-- Input for selection a level to load
|
||||
handleLvlSelectInput :: InputHandler Game
|
||||
handleLvlSelectInput = composeInputHandlers []
|
||||
|
||||
-- Go to the next stage of the Game
|
||||
setNextState :: Game -> Game
|
||||
setNextState game = game{ state = newState }
|
||||
|
|
Reference in a new issue