Fix: save score, highScore
This commit is contained in:
@@ -13,9 +13,11 @@ class Game {
|
||||
|
||||
let scoreBoard = new ScoreBoard();
|
||||
scoreManager.addOnChangeScoreListener( score => {
|
||||
sessionStorageManager.score = score;
|
||||
scoreBoard.printScore(NumberUtil.numberWithCommas(score));
|
||||
});
|
||||
scoreManager.addOnChangeHighScoreListener( highScore => {
|
||||
sessionStorageManager.highScore = highScore;
|
||||
screenBottom.printBottomLeftText("최고 기록 : " + NumberUtil.numberWithCommas(highScore));
|
||||
});
|
||||
|
||||
@@ -107,6 +109,12 @@ class Game {
|
||||
this.alienTimer.stop();
|
||||
|
||||
let gameOverText = new GameOverText();
|
||||
|
||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
||||
}
|
||||
|
||||
goResult() {
|
||||
location.href = '../../web/client/result.html';
|
||||
}
|
||||
|
||||
activateNextAlien() {
|
||||
@@ -127,4 +135,6 @@ class Game {
|
||||
heartManager.breakHearts(1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Game.GAME_OVER_WAIT_TIME_MS = 2000;
|
||||
Reference in New Issue
Block a user