2

所以我一直在尝试在 Gloss 上找到一些可以替代 state 的东西,所以当 state 为 2 时,Gloss 会退出。(我正在使用 Graphics.Gloss.Interface.Pure.Game)

我知道 exitWith 但不确定在这种情况下如何使用它,任何建议都值得赞赏。

...
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     
4

0 回答 0