Tank projectile collisions
This commit is contained in:
1 parent
141437836e
commit
c5ead3632f
3 files changed
+22
-4
No files matched your search
+6
-1
@@ -77,8 +77,13 @@ export const EXPLOSION_TYPES = {
|
||||
clipTerrain(terrain, (ctx) => drawExplosion(ctx, x, y, cr));
|
||||
},
|
||||
damage(explosion, player) {
|
||||
if (within(explosion.x, explosion.y, player.x, player.y, explosion.r)) {
|
||||
if (within(explosion.x, explosion.y, player.x-3, player.y, explosion.r)) {
|
||||
return 100;
|
||||
} else if (
|
||||
within(explosion.x, explosion.y, player.x-3, player.y, explosion.r) ||
|
||||
within(explosion.x, explosion.y, player.x+3, player.y, explosion.r)
|
||||
) {
|
||||
return 50;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user