change scoring and sorting
This commit is contained in:
parent
5414c719f1
commit
155257514d
4 changed files with 16 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue