Some optimizations
This commit is contained in:
parent
98ae7f48c5
commit
a1294859c7
3 changed files with 16 additions and 16 deletions
|
@ -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
|
||||
|
|
Reference in a new issue