summaryrefslogtreecommitdiffstats
path: root/src/DefaultPlayer.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-26 23:41:53 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-26 23:41:53 +0200
commitcfa9cf94568fbe1564e5b4e386a8170910bc552e (patch)
tree4775bfc3d4436431af43fc9fd45792f5cbf1f0b6 /src/DefaultPlayer.hs
parentae4a69415050b61f4488255dad0b1c3d045e6de5 (diff)
downloadhtanks-master.tar
htanks-master.zip
Refactored to/fromVector functionsHEADmaster
Diffstat (limited to 'src/DefaultPlayer.hs')
-rw-r--r--src/DefaultPlayer.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/DefaultPlayer.hs b/src/DefaultPlayer.hs
index 4ac6bac..bb8cf75 100644
--- a/src/DefaultPlayer.hs
+++ b/src/DefaultPlayer.hs
@@ -30,8 +30,8 @@ instance Player DefaultPlayer where
ax = realToFrac $ aimx - (fromRational . toRational . tankX $ tank)
ay = realToFrac $ aimy - (fromRational . toRational . tankY $ tank)
move = (x /= 0 || y /= 0)
- dir = if move then Just (fromVector $ Vector x y) else Nothing
- adir = if (ax /= 0 || ay /= 0) then Just (fromVector $ Vector ax ay) else Nothing
+ dir = if move then Just (fst . fromVector $ Vector x y) else Nothing
+ adir = if (ax /= 0 || ay /= 0) then Just (fst . fromVector $ Vector ax ay) else Nothing
in return (DefaultPlayer keys aimx aimy False, dir, move, adir, shoot)
handleEvent (DefaultPlayer keys aimx aimy shoot) ev