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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user