Added timer

This commit is contained in:
Martin
2022-12-13 18:21:04 +01:00
parent 6ad522a79d
commit bef7505584
3 changed files with 217 additions and 94 deletions

View File

@@ -48,6 +48,7 @@ export class Game extends Component {
private gamePauser: Pauser = new Pauser();
private static instance: Game;
private timeAlive = 0;
public static get Instance(): Game {
return this.instance;
@@ -136,6 +137,9 @@ export class Game extends Component {
this.diagonalProjectileLauncher.gameTick(deltaTime);
this.background.gameTick();
this.timeAlive += deltaTime;
this.gameUI.updateTimeAlive(this.timeAlive);
this.camera.node.worldPosition = this.player.node.worldPosition;
}