summaryrefslogtreecommitdiffstats
path: root/HTanks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'HTanks.hs')
-rw-r--r--HTanks.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/HTanks.hs b/HTanks.hs
index 1ca97c2..7f611f5 100644
--- a/HTanks.hs
+++ b/HTanks.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE PatternGuards #-}
+
import Game
import Level
import Tank
@@ -16,8 +18,9 @@ main = do
let gameState = GameState {level = testLevel, tanks = [Tank 0.5 0.5 0]}
- (_, gameState) <- runGame gameState $ mainLoop gl
- print $ tanks gameState
+ runGame gameState $ mainLoop gl
+
+ deinitGL gl
mainLoop :: Driver a => a -> Game ()
mainLoop gl = do
@@ -35,4 +38,6 @@ handleEvents gl = do
return True
handleEvent :: SomeEvent -> IO Bool
-handleEvent ev = return True \ No newline at end of file
+handleEvent ev
+ | Just QuitEvent <- fromEvent ev = return False
+ | otherwise = return True