summaryrefslogtreecommitdiffstats
path: root/HTanks.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-03-05 04:38:31 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-03-05 04:38:31 +0100
commit0fb75af68220527fb10ab0ce39e35f61cba67e4c (patch)
tree6bc7dd114daa0b74cb7d25743741de90dfc5a768 /HTanks.hs
parent1020310190063279b7951e44d8ae21fe3a623aa3 (diff)
downloadhtanks-0fb75af68220527fb10ab0ce39e35f61cba67e4c.tar
htanks-0fb75af68220527fb10ab0ce39e35f61cba67e4c.zip
Aim with mouse in DefaultPlayer
Diffstat (limited to 'HTanks.hs')
-rw-r--r--HTanks.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/HTanks.hs b/HTanks.hs
index 1bbae03..c27cb81 100644
--- a/HTanks.hs
+++ b/HTanks.hs
@@ -164,7 +164,8 @@ simulationStep = do
handleEvents :: Main ()
handleEvents = do
- event <- gets driver >>= liftIO . nextEvent
+ (newgl, event) <- gets driver >>= liftIO . nextEvent
+ modify $ \state -> state {driver = newgl}
when (isJust event) $ do
Main.handleEvent $ fromJust event
modify $ \state -> state {players = map (\p -> Player.handleEvent p $ fromJust event) $ players state}