change scoring and sorting

This commit is contained in:
biglyderv 2024-11-25 14:14:21 -05:00
parent 5414c719f1
commit 155257514d
4 changed files with 16 additions and 6 deletions

View file

@ -51,9 +51,13 @@ class Player extends Entity {
player.ticks = 0;
}
handleTick(game) {
let { entities, width, height } = game;
let ent = this;
ent.headCount += 1/200;
ent.headCount = Math.round(ent.headCount * 1000) / 1000;
if (ent.health <= 0) return;
@ -95,7 +99,7 @@ class Player extends Entity {
}
if (target.type == 'Shooter') {
this.health = 0;
this.health -= 1;
}
if (target.immortal) continue;
@ -113,7 +117,7 @@ class Player extends Entity {
console.log(`Player ${target.you} died to a player ${ent.you}`);
ent.health -= dmg;
if (ent.health > 100) ent.health = 100;
ent.headCount++;
ent.headCount += 100;
}
}
}