a
This commit is contained in:
parent
e5d946ba20
commit
708904715c
1 changed files with 3 additions and 1 deletions
|
@ -105,12 +105,14 @@ class Player {
|
||||||
}
|
}
|
||||||
if (target.immortal) continue;
|
if (target.immortal) continue;
|
||||||
|
|
||||||
|
let oldHealth = target.health
|
||||||
|
|
||||||
target.health += Math.floor( (dp-0.001) * 10);
|
target.health += Math.floor( (dp-0.001) * 10);
|
||||||
|
|
||||||
target.vel.x += (target.pos.x - ent.pos.x) * 0.1;
|
target.vel.x += (target.pos.x - ent.pos.x) * 0.1;
|
||||||
target.vel.y += (target.pos.y - ent.pos.y) * 0.1;
|
target.vel.y += (target.pos.y - ent.pos.y) * 0.1;
|
||||||
|
|
||||||
if (target.health == 0) {
|
if (target.health <= 0 && oldHealth > 0) {
|
||||||
ent.headCount++;
|
ent.headCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue