diff options
Diffstat (limited to 'src/DefaultPlayer.hs')
-rw-r--r-- | src/DefaultPlayer.hs | 4 |
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 |