diff options
| author | Jeanne-Kamikaze <jeannekamikaze@gmail.com> | 2013-08-17 18:59:29 +0200 |
|---|---|---|
| committer | Jeanne-Kamikaze <jeannekamikaze@gmail.com> | 2013-08-17 18:59:29 +0200 |
| commit | 12b9253d857be440b0fc72a3344de20e4c60732a (patch) | |
| tree | 100c05f427a65b1949dbbcc4db3d5dbd8f86e281 /demos/pong | |
| parent | 59d2edd9877a2aa1e243597052a3af6bbeefa3cf (diff) | |
Added run function
Diffstat (limited to 'demos/pong')
| -rw-r--r-- | demos/pong/Main.hs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/demos/pong/Main.hs b/demos/pong/Main.hs index 8c379ec..e9a6dc1 100644 --- a/demos/pong/Main.hs +++ b/demos/pong/Main.hs | |||
| @@ -18,14 +18,9 @@ data GameState = GameState | |||
| 18 | , world :: [GameObject] | 18 | , world :: [GameObject] |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | main = do | 21 | main = run |
| 22 | result <- run | 22 | $ withWindow (640,480) [] Window (2,0) (Just "Pong") initGame |
| 23 | case result of | 23 | $ loop (Just 30) step |
| 24 | Left err -> putStrLn err | ||
| 25 | Right _ -> return () | ||
| 26 | |||
| 27 | run = withWindow (640,480) [] Window (2,0) (Just "Pong") initGame | ||
| 28 | $ loop (Just 30) step | ||
| 29 | 24 | ||
| 30 | initGame wnd = do | 25 | initGame wnd = do |
| 31 | gameIO $ do | 26 | gameIO $ do |
