Fix: save score, highScore

This commit is contained in:
2018-05-15 21:57:23 +09:00
parent ade28f781b
commit 3ed621d9f3
4 changed files with 40 additions and 14 deletions
+11 -1
View File
@@ -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;