diff --git a/src/main.js b/src/main.js index 5633db1..a94421f 100644 --- a/src/main.js +++ b/src/main.js @@ -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; } diff --git a/src/weapons.js b/src/weapons.js index af584e0..d86f460 100644 --- a/src/weapons.js +++ b/src/weapons.js @@ -89,7 +89,7 @@ export const EXPLOSION_TYPES = { }, clip(explosion, terrain) { const {x, y, cr} = explosion; - drawDirt(terrain, x, y, cr); + drawDirt(terrain, x, y, cr, terrain.color); }, damage(explosion, player) {} }, @@ -139,7 +139,7 @@ export const EXPLOSION_TYPES = { const {x, y, cr, osc, pattern} = explosion; let row = []; - for (let cx=0; cx<=1+cr*2; cx++) { + for (let cx=0; cx < 1+cr*2; cx++) { row.push(randomInt(0, 3) === 0); } pattern.push(row);