Fix: show best record with DB
This commit is contained in:
@@ -6,21 +6,13 @@ class Game {
|
||||
create() {
|
||||
this.game.stage.backgroundColor = '#4d4d4d';
|
||||
|
||||
sessionStorageManager.isNewBestRecrd = false;
|
||||
|
||||
// top
|
||||
let backButton = new BackButton( () => {
|
||||
location.href = '../../web/client/menu_app.html';
|
||||
});
|
||||
|
||||
let scoreBoard = new ScoreBoard();
|
||||
scoreManager.addOnChangeScoreListener( score => {
|
||||
sessionStorageManager.record = score;
|
||||
scoreBoard.printScore(NumberUtil.numberWithCommas(score));
|
||||
});
|
||||
scoreManager.addOnChangeHighScoreListener( highScore => {
|
||||
sessionStorageManager.bestRecord = highScore;
|
||||
screenBottom.printBottomLeftText("최고 기록 : " + NumberUtil.numberWithCommas(highScore));
|
||||
});
|
||||
|
||||
let heartGauge = new HeartGauge(heartManager);
|
||||
heartManager.addOnChangeGameOverListener(
|
||||
() => { this.gameOver(); }
|
||||
@@ -30,6 +22,18 @@ class Game {
|
||||
let fullscreenButton = new FullscreenButton(this.game);
|
||||
|
||||
|
||||
let scoreBoard = new ScoreBoard();
|
||||
scoreManager.addOnChangeScoreListener( score => {
|
||||
sessionStorageManager.record = score;
|
||||
scoreBoard.printScore(NumberUtil.numberWithCommas(score));
|
||||
});
|
||||
scoreManager.addOnChangeHighScoreListener( highScore => {
|
||||
sessionStorageManager.bestRecord = highScore;
|
||||
sessionStorageManager.isNewBestRecrd = true;
|
||||
screenBottom.printBottomLeftTextWithBestRecord();
|
||||
});
|
||||
|
||||
|
||||
// waiting room
|
||||
this.game.add.graphics()
|
||||
.beginFill(0xffffff, 0.1)
|
||||
@@ -58,8 +62,7 @@ class Game {
|
||||
// bottom
|
||||
let screenBottom = new ScreenBottom();
|
||||
screenBottom.makeBottomLine();
|
||||
let highScore = NumberUtil.numberWithCommas(scoreManager.getHighScore());
|
||||
screenBottom.printBottomLeftText("최고 기록 : " + highScore);
|
||||
screenBottom.printBottomLeftTextWithBestRecord(sessionStorageManager.bestRecord);
|
||||
screenBottom.printBottomCenterText(sessionStorageManager.playingAppKoreanName);
|
||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user