3

So i've been trying for a while to find something on Gloss that i can substitute for state so when state is 2, Gloss would exit. (I'm using Graphics.Gloss.Interface.Pure.Game)

I know of exitWith but not sure how to use it in this case, any suggestions are appreciated.

...
step :: Int -> Int
step (EventKey (SpecialKey KeyEnter) Down _ _) state | state == 0 = state + 1 
                                                     | state == 1 = state + 2                                                      
                                                     | state == 2 = ?
...
main :: IO ()
main = do play janela                 
               white                
               60                       
               0
               drawstate      
               step               
               time     
Karlofsky
  • 35
  • 4

0 Answers0