#15 Basic input handling
This commit is contained in:
parent
9e5f22458c
commit
cdd0c3989c
4 changed files with 70 additions and 7 deletions
23
lib/control/Input.hs
Normal file
23
lib/control/Input.hs
Normal file
|
@ -0,0 +1,23 @@
|
|||
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 = composeInputHandlers [
|
||||
handleSpecialKey KeySpace setNextState
|
||||
]
|
||||
|
||||
-- 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