restart on escape
This commit is contained in:
parent
086302be5e
commit
e0a272fb4e
1 changed files with 9 additions and 1 deletions
10
src/Main.hs
10
src/Main.hs
|
@ -68,7 +68,15 @@ pre = do
|
|||
|
||||
quitGame :: KeyboardMessage -> Affection UserData ()
|
||||
quitGame (MsgKeyboardEvent _ _ SDL.Pressed False sym)
|
||||
| SDL.keysymKeycode sym == SDL.KeycodeEscape = quit
|
||||
| SDL.keysymKeycode sym == SDL.KeycodeEscape = do
|
||||
ad <- A.get
|
||||
ud <- getAffection
|
||||
SDL.glMakeCurrent (drawWindow ad) (glContext ad)
|
||||
(ws, _) <- yieldSystemT (0, defStorage) (return ())
|
||||
putAffection ud
|
||||
{ worldState = ws
|
||||
}
|
||||
smLoad Load
|
||||
| otherwise = return ()
|
||||
quitGame _ = return ()
|
||||
|
||||
|
|
Loading…
Reference in a new issue