Fix: updateRecord before Result
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
var Game = {
|
||||
|
||||
create: function() {
|
||||
this.dbConnectManager = new DBConnectManager();
|
||||
|
||||
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
|
||||
|
||||
sessionStorageManager.setIsNewAppHighestRecord(false);
|
||||
|
||||
var experienceAppTimer = new ExperienceAppTimer();
|
||||
experienceAppTimer.setTimeOverListener(
|
||||
(function() { this.gameOver(); }).bind(this)
|
||||
);
|
||||
|
||||
// keyboard shortcut
|
||||
this.keyboardShortcut = new KeyboardShortcut();
|
||||
this.keyboardShortcut.addCallback(
|
||||
@@ -46,7 +43,7 @@ var Game = {
|
||||
Game.GAME_TIME_SEC,
|
||||
(function() {
|
||||
this.setClickEnable(false);
|
||||
this.gameOver();
|
||||
this.timeOver();
|
||||
}).bind(this)
|
||||
);
|
||||
|
||||
@@ -85,6 +82,12 @@ var Game = {
|
||||
this.speechBubble.hideSpeechBubble();
|
||||
|
||||
|
||||
var experienceAppTimer = new ExperienceAppTimer();
|
||||
experienceAppTimer.setTimeOverListener(
|
||||
(function() { this.timeOver(); }).bind(this)
|
||||
);
|
||||
|
||||
|
||||
// bottom ui
|
||||
var screenBottomUI = new ScreenBottomUI();
|
||||
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
|
||||
@@ -287,8 +290,14 @@ var Game = {
|
||||
},
|
||||
|
||||
|
||||
timeOver: function() {
|
||||
var timeOverText = new TimeOverText();
|
||||
if(!isExperienceMaestroAccount())
|
||||
this.updateResultRecord();
|
||||
this.stopAndGoResult();
|
||||
},
|
||||
|
||||
gameOver: function() {
|
||||
stopAndGoResult: function() {
|
||||
for(var i = 0; i < this.gameTimeEvents.length; i++) {
|
||||
game.time.events.remove(this.gameTimeEvents[i]);
|
||||
}
|
||||
@@ -298,11 +307,20 @@ var Game = {
|
||||
this.meatGroup.children[i].hide();
|
||||
}
|
||||
|
||||
var gameOverText = new GameOverText();
|
||||
|
||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
||||
},
|
||||
|
||||
updateResultRecord: function() {
|
||||
if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
|
||||
this.dbConnectManager.updateResultRecord(
|
||||
sessionStorageManager.getMaestroID(),
|
||||
sessionStorageManager.getPlayerID(),
|
||||
sessionStorageManager.getPlayingAppID(),
|
||||
sessionStorageManager.getRecord()
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
goResult: function() {
|
||||
location.href = '../../web/client/result.html';
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user