AppRoot loading

This commit is contained in:
Martin
2023-01-02 11:14:44 +01:00
parent 6961e48c15
commit d32340471b
4 changed files with 157 additions and 36 deletions

View File

@@ -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");
}
}
}