#18 & massive structure overhaul
This commit is contained in:
parent
83659e69b4
commit
3b0de65de1
16 changed files with 397 additions and 221 deletions
|
@ -1,27 +0,0 @@
|
|||
module Input
|
||||
(
|
||||
-- Handle all input for RPG-Engine
|
||||
handleAllInput
|
||||
) where
|
||||
|
||||
import Game
|
||||
import State
|
||||
import InputHandling
|
||||
|
||||
import Graphics.Gloss.Interface.IO.Game
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
handleAllInput :: InputHandler Game
|
||||
handleAllInput ev g@Game{ state = Playing } = handlePlayInputs ev g
|
||||
handleAllInput ev g = handleAnyKey setNextState ev g
|
||||
|
||||
handlePlayInputs :: InputHandler Game
|
||||
handlePlayInputs = composeInputHandlers [
|
||||
handleKey (Char 'p') (\game -> game{ state = Pause })
|
||||
]
|
||||
|
||||
-- Go to the next stage of the Game
|
||||
setNextState :: Game -> Game
|
||||
setNextState game = game{ state = newState }
|
||||
where newState = nextState $ state game
|
Reference in a new issue