From 2bb85618366681c7c97f8b36cc85a18c45beb924 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 9 Mar 2010 03:19:34 +0100 Subject: Renamed some Tank and Shoot accessors --- DefaultPlayer.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'DefaultPlayer.hs') 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 -- cgit v1.2.3