summaryrefslogtreecommitdiffstats
path: root/HTanks.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-02-25 04:38:14 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-02-25 04:38:14 +0100
commitb4f295da9183d442b87396f07284b7624b90892e (patch)
tree4136ca52ff61d23eb97962fc91f73472f0bcde33 /HTanks.hs
parent656b5e8bc14b7abda8a836f8eeb3b0a972f0484a (diff)
downloadhtanks-b4f295da9183d442b87396f07284b7624b90892e.tar
htanks-b4f295da9183d442b87396f07284b7624b90892e.zip
Added tank texture and turn to drive direction
Diffstat (limited to 'HTanks.hs')
-rw-r--r--HTanks.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/HTanks.hs b/HTanks.hs
index d0dab4a..8d3603e 100644
--- a/HTanks.hs
+++ b/HTanks.hs
@@ -97,7 +97,7 @@ simulationStep = do
let dx = (speed oldtank) * fromRational (round (x*1000/length)%1000000)
dy = (speed oldtank) * fromRational (round (y*1000/length)%1000000)
- let tank = oldtank {posx = dx + posx oldtank, posy = dy + posy oldtank}
+ let tank = oldtank {posx = dx + posx oldtank, posy = dy + posy oldtank, dir = fromRational $ round ((atan2 y x)*1000000*180/pi)%1000000}
lift $ modify $ \state -> state {tanks = tank:(tail . tanks $ state)}