From 8f1fd98cd69659446b9fdd11c0f3d2b860d779f7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 24 Jun 2011 23:04:21 +0200 Subject: Consider bullet diameter in tank/bullet collision tests --- src/Collision.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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')) -- cgit v1.2.3