mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-10-09 08:36:14 +00:00
AppRoot loading
This commit is contained in:
@@ -73,6 +73,8 @@ export class Player extends Component {
|
||||
}
|
||||
|
||||
private move(deltaTime: number): void {
|
||||
if (!this.health.IsAlive) return;
|
||||
|
||||
const movement: Vec2 = this.input.getAxis();
|
||||
if (!movement.equals(Vec2.ZERO)) {
|
||||
movement.x *= deltaTime * this.speed;
|
||||
@@ -111,6 +113,10 @@ export class Player extends Component {
|
||||
|
||||
await delay(100);
|
||||
this.sprite.color = Color.WHITE;
|
||||
|
||||
if (!this.health.IsAlive) {
|
||||
this.animation.play("Die");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user