summaryrefslogtreecommitdiffstats
path: root/DefaultPlayer.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-03-09 03:19:34 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-03-09 03:19:34 +0100
commit2bb85618366681c7c97f8b36cc85a18c45beb924 (patch)
treef3874e2fdd85cd9c5c13839e46d751d3f8966af6 /DefaultPlayer.hs
parentaa00912206351431e931cde0645712c3016edf70 (diff)
downloadhtanks-2bb85618366681c7c97f8b36cc85a18c45beb924.tar
htanks-2bb85618366681c7c97f8b36cc85a18c45beb924.zip
Renamed some Tank and Shoot accessors
Diffstat (limited to 'DefaultPlayer.hs')
-rw-r--r--DefaultPlayer.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/DefaultPlayer.hs b/DefaultPlayer.hs
index 431b298..af9aaf5 100644
--- a/DefaultPlayer.hs
+++ b/DefaultPlayer.hs
@@ -21,8 +21,8 @@ instance Player DefaultPlayer where
playerUpdate (DefaultPlayer keys aimx aimy shoot) tank =
let x = (if (S.member KeyLeft keys) then (-1) else 0) + (if (S.member KeyRight keys) then 1 else 0)
y = (if (S.member KeyDown keys) then (-1) else 0) + (if (S.member KeyUp keys) then 1 else 0)
- ax = aimx - (fromRational . toRational $ posx tank)
- ay = aimy - (fromRational . toRational $ posy tank)
+ ax = aimx - (fromRational . toRational . tankX $ tank)
+ ay = aimy - (fromRational . toRational . tankY $ tank)
move = (x /= 0 || y /= 0)
angle = if move then Just $ fromRational $ round ((atan2 y x)*1000000*180/pi)%1000000 else Nothing
aangle = if (ax /= 0 || ay /= 0) then Just $ fromRational $ round ((atan2 ay ax)*1000000*180/pi)%1000000 else Nothing