Some optimizations

This commit is contained in:
Matthias Schiffer 2010-03-17 17:55:03 +01:00
parent 98ae7f48c5
commit a1294859c7
3 changed files with 16 additions and 16 deletions

View file

@ -15,7 +15,7 @@ tankLength :: Micro
tankLength = 0.95
bulletDiameter :: Micro
bulletDiameter = 0.2
bulletDiameter = 0.1
collisionTankBorder :: Micro -> Micro -> Tank -> Tank
collisionTankBorder lw lh tank = tank {tankX = newx, tankY = newy}
@ -48,4 +48,4 @@ collisionTankBorder lw lh tank = tank {tankX = newx, tankY = newy}
collisionBulletBullet :: (Bullet, Bullet) -> (Bullet, Bullet) -> Bool
collisionBulletBullet (b1, b1') (b2, b2') = distancesq < (bulletDiameter^2)
where
distancesq = (bulletX b1' - bulletX b2')^2 + (bulletY b1' - bulletY b2')^2
distancesq = (bulletX b1' - bulletX b2')^2 + (bulletY b1' - bulletY b2')^2