diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-24 23:04:21 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-24 23:04:21 +0200 |
commit | 8f1fd98cd69659446b9fdd11c0f3d2b860d779f7 (patch) | |
tree | d3c89a4fa65bab3ed86ea278be884ae661d702ec /src | |
parent | 83f0606ea9dfd6b493097dc97330055dff4a2867 (diff) | |
download | htanks-8f1fd98cd69659446b9fdd11c0f3d2b860d779f7.tar htanks-8f1fd98cd69659446b9fdd11c0f3d2b860d779f7.zip |
Consider bullet diameter in tank/bullet collision tests
Diffstat (limited to 'src')
-rw-r--r-- | src/Collision.hs | 8 |
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')) |