#9 Added level selection render

This commit is contained in:
Tibo De Peuter 2022-12-21 16:07:05 +01:00
parent 0786a41006
commit 2055ef234e
17 changed files with 401 additions and 34 deletions

View file

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