summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-24 23:04:21 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-24 23:04:21 +0200
commit8f1fd98cd69659446b9fdd11c0f3d2b860d779f7 (patch)
treed3c89a4fa65bab3ed86ea278be884ae661d702ec
parent83f0606ea9dfd6b493097dc97330055dff4a2867 (diff)
downloadhtanks-8f1fd98cd69659446b9fdd11c0f3d2b860d779f7.tar
htanks-8f1fd98cd69659446b9fdd11c0f3d2b860d779f7.zip
Consider bullet diameter in tank/bullet collision tests
-rw-r--r--src/Collision.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Collision.hs b/src/Collision.hs
index 909e7f7..6ce2df7 100644
--- a/src/Collision.hs
+++ b/src/Collision.hs
@@ -56,10 +56,10 @@ collisionBulletTank (b, b') (tank, tank') = (not ((between bx minx maxx) && (bet
V.Vector bx by = (rotp tank) . (transp tank) $ bulletPos b
V.Vector bx' by' = (rotp tank') . (transp tank') $ bulletPos b'
- minx = -tankLength/2
- maxx = tankLength/2
- miny = -tankWidth/2
- maxy = tankWidth/2
+ minx = -(tankLength+bulletDiameter)/2
+ maxx = (tankLength+bulletDiameter)/2
+ miny = -(tankWidth+bulletDiameter)/2
+ maxy = (tankWidth+bulletDiameter)/2
collisionTankTank :: ((Tank, Tank), (Tank, Tank)) -> ((Tank, Tank), (Tank, Tank))
collisionTankTank ((t1, t1'), (t2, t2')) = ((t1, t1'), (t2, t2'))