summaryrefslogtreecommitdiffstats
path: root/HTanks.hs
diff options
context:
space:
mode:
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)}