Fix: stop watch for 1to50
This commit is contained in:
@@ -27,22 +27,7 @@ var Game = {
|
||||
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||
screenTopUI.makeFullScreenButton();
|
||||
|
||||
this.scoreManager = new ScoreManager();
|
||||
this.scoreBoard = new ScoreBoard();
|
||||
this.scoreManager.addOnChangeScoreListener(
|
||||
(function(score) {
|
||||
sessionStorageManager.setRecord(score);
|
||||
this.scoreBoard.printScore(NumberUtil.numberWithCommas(score));
|
||||
}).bind(this)
|
||||
);
|
||||
this.scoreManager.addOnChangeHighScoreListener(
|
||||
(function(highScore) {
|
||||
// console.log(highScore);
|
||||
// sessionStorageManager.setAppHighestRecord(highScore);
|
||||
sessionStorageManager.setIsNewBestRecrd(true);
|
||||
// this.screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
|
||||
}).bind(this)
|
||||
);
|
||||
this.stopWatch = new StopWatch(game);
|
||||
|
||||
|
||||
this.initVariables();
|
||||
@@ -73,10 +58,16 @@ var Game = {
|
||||
|
||||
|
||||
startGame: function() {
|
||||
this.startStage();
|
||||
this.stopWatch.start();
|
||||
},
|
||||
|
||||
startStage: function() {
|
||||
gameClear: function() {
|
||||
var recordTime = this.stopWatch.stop();
|
||||
sessionStorageManager.setRecord(recordTime);
|
||||
if(!isExperienceMaestroAccount())
|
||||
this.updateResultRecord();
|
||||
|
||||
game.time.events.add(Game.GAME_OVER_WAIT_TIME_MS, this.goResult, this);
|
||||
},
|
||||
|
||||
timeOver: function() {
|
||||
@@ -84,7 +75,12 @@ var Game = {
|
||||
if(!isExperienceMaestroAccount())
|
||||
this.updateResultRecord();
|
||||
|
||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
||||
var recordTime = this.stopWatch.stop();
|
||||
sessionStorageManager.setRecord(recordTime);
|
||||
if(!isExperienceMaestroAccount())
|
||||
this.updateResultRecord();
|
||||
|
||||
game.time.events.add(Game.GAME_OVER_WAIT_TIME_MS, this.goResult, this);
|
||||
},
|
||||
|
||||
updateResultRecord: function() {
|
||||
@@ -105,5 +101,6 @@ var Game = {
|
||||
}
|
||||
|
||||
|
||||
Game.GAME_OVER_WAIT_TIME_MS = 3000;
|
||||
// Game.GAME_TIME_SEC = 60;
|
||||
// Game.NEXT_STAGE_DELAY_MS = 500;
|
||||
Reference in New Issue
Block a user