fixes and minor improvements
This commit is contained in:
1 parent
ba794804e3
commit
682a8106b5
2 files changed
+3
-6
No files matched your search
+1
-4
@@ -885,11 +885,8 @@ function updateParticle(p) {
|
||||
function applyFireDamage(dt) {
|
||||
for (let player of players) {
|
||||
if (player.dead) continue;
|
||||
const fx = Math.round(player.x);
|
||||
const fy = player.y;
|
||||
for (let fire of fireCells) {
|
||||
if (fire.x >= fx - 5 && fire.x <= fx + 5 &&
|
||||
fire.y >= fy - 3 && fire.y <= fy + 2) {
|
||||
if (distance(fire.x, fire.y, player.x, player.y + PLAYER_TANK_Y_FOOTPRINT) <= PLAYER_TANK_BOUNDING_RADIUS + 1) {
|
||||
player.energy -= FIRE_DAMAGE * dt;
|
||||
player.lastDamageSource = fire.source;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user