Fix: updateRecord before Result
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
MissionClearText.prototype = Object.create(Phaser.Text.prototype);
|
||||||
|
MissionClearText.constructor = MissionClearText;
|
||||||
|
|
||||||
|
function MissionClearText() {
|
||||||
|
Phaser.Text.call(
|
||||||
|
this, game,
|
||||||
|
game.world.width / 2,
|
||||||
|
game.world.height / 2 - MissionClearText.MOVE_AMOUNT_PX,
|
||||||
|
"작업 완료",
|
||||||
|
MissionClearText.DEFAULT_TEXT_FONT
|
||||||
|
);
|
||||||
|
// super(game, 600, 300, "게임 오버", MissionClearText.DEFAULT_TEXT_FONT);
|
||||||
|
|
||||||
|
this.anchor.set(0.5);
|
||||||
|
this.inputEnabled = false;
|
||||||
|
|
||||||
|
var grd = this.context.createLinearGradient(0, 0, 0, this.height);
|
||||||
|
grd.addColorStop(0, '#8ED6FF');
|
||||||
|
grd.addColorStop(1, '#4C6CB3');
|
||||||
|
this.fill = grd;
|
||||||
|
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||||
|
this.stroke = '#000';
|
||||||
|
this.strokeThickness = 10;
|
||||||
|
|
||||||
|
|
||||||
|
this.alpha = 0;
|
||||||
|
var tweenAlpha = game.add.tween(this);
|
||||||
|
tweenAlpha.to( { alpha: 1 }, MissionClearText.TWEEN_ALPHA_TIME, Phaser.Easing.Linear.None, true);
|
||||||
|
|
||||||
|
var tweenMove = game.add.tween(this);
|
||||||
|
tweenMove.to( { y: game.world.height / 2 }, MissionClearText.TWEEN_MOVE_TIME, Phaser.Easing.Bounce.Out, true);
|
||||||
|
|
||||||
|
game.add.existing(this);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
MissionClearText.DEFAULT_TEXT_FONT = {
|
||||||
|
font: "bold 100px Arial",
|
||||||
|
boundsAlignH: "center", // left, center. right
|
||||||
|
boundsAlignV: "middle", // top, middle, bottom
|
||||||
|
fill: "#fff"
|
||||||
|
};
|
||||||
|
|
||||||
|
MissionClearText.MOVE_AMOUNT_PX = 200;
|
||||||
|
MissionClearText.TWEEN_ALPHA_TIME = 1000;
|
||||||
|
MissionClearText.TWEEN_MOVE_TIME = 1500;
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
TimeOverText.prototype = Object.create(Phaser.Text.prototype);
|
||||||
|
TimeOverText.constructor = TimeOverText;
|
||||||
|
|
||||||
|
function TimeOverText() {
|
||||||
|
Phaser.Text.call(
|
||||||
|
this, game,
|
||||||
|
game.world.width / 2,
|
||||||
|
game.world.height / 2 - TimeOverText.MOVE_AMOUNT_PX,
|
||||||
|
"타임 오버",
|
||||||
|
TimeOverText.DEFAULT_TEXT_FONT
|
||||||
|
);
|
||||||
|
// super(game, 600, 300, "게임 오버", TimeOverText.DEFAULT_TEXT_FONT);
|
||||||
|
|
||||||
|
this.anchor.set(0.5);
|
||||||
|
this.inputEnabled = false;
|
||||||
|
|
||||||
|
var grd = this.context.createLinearGradient(0, 0, 0, this.height);
|
||||||
|
grd.addColorStop(0, '#FFD68E');
|
||||||
|
grd.addColorStop(1, '#B34C00');
|
||||||
|
this.fill = grd;
|
||||||
|
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||||
|
this.stroke = '#000';
|
||||||
|
this.strokeThickness = 10;
|
||||||
|
|
||||||
|
|
||||||
|
this.alpha = 0;
|
||||||
|
var tweenAlpha = game.add.tween(this);
|
||||||
|
tweenAlpha.to( { alpha: 1 }, TimeOverText.TWEEN_ALPHA_TIME, Phaser.Easing.Linear.None, true);
|
||||||
|
|
||||||
|
var tweenMove = game.add.tween(this);
|
||||||
|
tweenMove.to( { y: game.world.height / 2 }, TimeOverText.TWEEN_MOVE_TIME, Phaser.Easing.Bounce.Out, true);
|
||||||
|
|
||||||
|
game.add.existing(this);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
TimeOverText.DEFAULT_TEXT_FONT = {
|
||||||
|
font: "bold 100px Arial",
|
||||||
|
boundsAlignH: "center", // left, center. right
|
||||||
|
boundsAlignV: "middle", // top, middle, bottom
|
||||||
|
fill: "#fff"
|
||||||
|
};
|
||||||
|
|
||||||
|
TimeOverText.MOVE_AMOUNT_PX = 200;
|
||||||
|
TimeOverText.TWEEN_ALPHA_TIME = 1000;
|
||||||
|
TimeOverText.TWEEN_MOVE_TIME = 1500;
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
var Game = {
|
var Game = {
|
||||||
|
|
||||||
create: function() {
|
create: function() {
|
||||||
|
this.dbConnectManager = new DBConnectManager();
|
||||||
|
|
||||||
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
|
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
|
||||||
|
|
||||||
sessionStorageManager.setIsNewAppHighestRecord(false);
|
sessionStorageManager.setIsNewAppHighestRecord(false);
|
||||||
|
|
||||||
var experienceAppTimer = new ExperienceAppTimer();
|
var experienceAppTimer = new ExperienceAppTimer();
|
||||||
experienceAppTimer.setTimeOverListener(
|
experienceAppTimer.setTimeOverListener(
|
||||||
(function() { this.gameOver(); }).bind(this)
|
(function() { this.timeOver(); }).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
// keyboard shortcut
|
// keyboard shortcut
|
||||||
@@ -47,7 +49,7 @@ var Game = {
|
|||||||
(function() {
|
(function() {
|
||||||
this.setClickEnable(false);
|
this.setClickEnable(false);
|
||||||
|
|
||||||
this.gameOver();
|
this.timeOver();
|
||||||
}).bind(this)
|
}).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -540,7 +542,11 @@ var Game = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
gameOver: function() {
|
timeOver: function() {
|
||||||
|
var timeOverText = new TimeOverText();
|
||||||
|
if(!isExperienceMaestroAccount())
|
||||||
|
this.updateResultRecord();
|
||||||
|
|
||||||
this.activatedCardColumnNo = 0;
|
this.activatedCardColumnNo = 0;
|
||||||
this.activatedCardRowNo = 0;
|
this.activatedCardRowNo = 0;
|
||||||
this.initCards();
|
this.initCards();
|
||||||
@@ -553,11 +559,20 @@ var Game = {
|
|||||||
}
|
}
|
||||||
this.gameTimeEvents = [];
|
this.gameTimeEvents = [];
|
||||||
|
|
||||||
var gameOverText = new GameOverText();
|
|
||||||
|
|
||||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
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() {
|
goResult: function() {
|
||||||
location.href = '../../web/client/result.html';
|
location.href = '../../web/client/result.html';
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ var Game = {
|
|||||||
// },
|
// },
|
||||||
|
|
||||||
create: function() {
|
create: function() {
|
||||||
|
this.dbConnectManager = new DBConnectManager();
|
||||||
|
|
||||||
game.physics.enable(this, Phaser.Physics.ARCADE);
|
game.physics.enable(this, Phaser.Physics.ARCADE);
|
||||||
|
|
||||||
this.indexMissile = 0;
|
this.indexMissile = 0;
|
||||||
@@ -15,7 +17,7 @@ var Game = {
|
|||||||
|
|
||||||
var experienceAppTimer = new ExperienceAppTimer();
|
var experienceAppTimer = new ExperienceAppTimer();
|
||||||
experienceAppTimer.setTimeOverListener(
|
experienceAppTimer.setTimeOverListener(
|
||||||
(function() { this.gameOver(); }).bind(this)
|
(function() { this.timeOver(); }).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
// keyboard shortcut
|
// keyboard shortcut
|
||||||
@@ -39,19 +41,18 @@ var Game = {
|
|||||||
// contents
|
// contents
|
||||||
this.spaceship = new Spaceship();
|
this.spaceship = new Spaceship();
|
||||||
|
|
||||||
this.aliens = [];
|
this.missiles = [];
|
||||||
for(var i = 0; i < Game.MAX_MISSILE_COUNT; i++) {
|
for(var i = 0; i < Game.MAX_MISSILE_COUNT; i++) {
|
||||||
var alien = new Missile(this.spaceship,
|
var alien = new Missile(this.spaceship,
|
||||||
(function() {
|
(function() {
|
||||||
this.spaceship.alpha = 0;
|
this.spaceship.alpha = 0;
|
||||||
this.spaceship.body.enable = false;
|
this.spaceship.body.enable = false;
|
||||||
|
|
||||||
this.showExplosionParticle();
|
this.showExplosionParticle();
|
||||||
|
|
||||||
this.gameOver();
|
this.gameOver();
|
||||||
}).bind(this) // onCollisionHandler
|
}).bind(this) // onCollisionHandler
|
||||||
);
|
);
|
||||||
this.aliens.push(alien);
|
this.missiles.push(alien);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -141,20 +142,45 @@ var Game = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.aliens[this.indexMissile].setActive(true);
|
this.missiles[this.indexMissile].setActive(true);
|
||||||
// console.log(this.indexMissile);
|
// console.log(this.indexMissile);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
timeOver: function() {
|
||||||
|
this.spaceship.alpha = 0;
|
||||||
|
this.spaceship.body.enable = false;
|
||||||
|
this.showExplosionParticle();
|
||||||
|
|
||||||
|
var timeOverText = new TimeOverText();
|
||||||
|
this.stopAndGoResult();
|
||||||
|
},
|
||||||
|
|
||||||
gameOver: function() {
|
gameOver: function() {
|
||||||
var gameOverText = new GameOverText();
|
var gameOverText = new GameOverText();
|
||||||
|
this.stopAndGoResult();
|
||||||
|
},
|
||||||
|
|
||||||
|
stopAndGoResult: function() {
|
||||||
var recordTime = this.stopWatch.stop();
|
var recordTime = this.stopWatch.stop();
|
||||||
sessionStorageManager.setRecord(recordTime);
|
sessionStorageManager.setRecord(recordTime);
|
||||||
|
if(!isExperienceMaestroAccount())
|
||||||
|
this.updateResultRecord();
|
||||||
|
|
||||||
game.time.events.add(Game.GAME_OVER_WAIT_TIME_MS, this.goResult, this);
|
game.time.events.add(Game.GAME_OVER_WAIT_TIME_MS, this.goResult, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateResultRecord: function() {
|
||||||
|
if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
|
||||||
|
this.dbConnectManager.updateResultRecord(
|
||||||
|
sessionStorageManager.getMaestroID(),
|
||||||
|
sessionStorageManager.getPlayerID(),
|
||||||
|
sessionStorageManager.getPlayingAppID(),
|
||||||
|
sessionStorageManager.getRecord()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
goResult: function() {
|
goResult: function() {
|
||||||
location.href = '../../web/client/result.html';
|
location.href = '../../web/client/result.html';
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
var Game = {
|
var Game = {
|
||||||
|
|
||||||
create: function() {
|
create: function() {
|
||||||
|
this.dbConnectManager = new DBConnectManager();
|
||||||
|
|
||||||
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
|
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
|
||||||
|
|
||||||
sessionStorageManager.setIsNewAppHighestRecord(false);
|
sessionStorageManager.setIsNewAppHighestRecord(false);
|
||||||
|
|
||||||
var experienceAppTimer = new ExperienceAppTimer();
|
|
||||||
experienceAppTimer.setTimeOverListener(
|
|
||||||
(function() { this.gameOver(); }).bind(this)
|
|
||||||
);
|
|
||||||
|
|
||||||
// keyboard shortcut
|
// keyboard shortcut
|
||||||
this.keyboardShortcut = new KeyboardShortcut();
|
this.keyboardShortcut = new KeyboardShortcut();
|
||||||
this.keyboardShortcut.addCallback(
|
this.keyboardShortcut.addCallback(
|
||||||
@@ -46,7 +43,7 @@ var Game = {
|
|||||||
Game.GAME_TIME_SEC,
|
Game.GAME_TIME_SEC,
|
||||||
(function() {
|
(function() {
|
||||||
this.setClickEnable(false);
|
this.setClickEnable(false);
|
||||||
this.gameOver();
|
this.timeOver();
|
||||||
}).bind(this)
|
}).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -85,6 +82,12 @@ var Game = {
|
|||||||
this.speechBubble.hideSpeechBubble();
|
this.speechBubble.hideSpeechBubble();
|
||||||
|
|
||||||
|
|
||||||
|
var experienceAppTimer = new ExperienceAppTimer();
|
||||||
|
experienceAppTimer.setTimeOverListener(
|
||||||
|
(function() { this.timeOver(); }).bind(this)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// bottom ui
|
// bottom ui
|
||||||
var screenBottomUI = new ScreenBottomUI();
|
var screenBottomUI = new ScreenBottomUI();
|
||||||
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
|
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++) {
|
for(var i = 0; i < this.gameTimeEvents.length; i++) {
|
||||||
game.time.events.remove(this.gameTimeEvents[i]);
|
game.time.events.remove(this.gameTimeEvents[i]);
|
||||||
}
|
}
|
||||||
@@ -298,11 +307,20 @@ var Game = {
|
|||||||
this.meatGroup.children[i].hide();
|
this.meatGroup.children[i].hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
var gameOverText = new GameOverText();
|
|
||||||
|
|
||||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
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() {
|
goResult: function() {
|
||||||
location.href = '../../web/client/result.html';
|
location.href = '../../web/client/result.html';
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
var Game = {
|
var Game = {
|
||||||
|
|
||||||
create: function() {
|
create: function() {
|
||||||
|
this.dbConnectManager = new DBConnectManager();
|
||||||
|
|
||||||
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
|
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
|
||||||
|
|
||||||
sessionStorageManager.setIsNewAppHighestRecord(false);
|
sessionStorageManager.setIsNewAppHighestRecord(false);
|
||||||
|
|
||||||
var experienceAppTimer = new ExperienceAppTimer();
|
var experienceAppTimer = new ExperienceAppTimer();
|
||||||
experienceAppTimer.setTimeOverListener(
|
experienceAppTimer.setTimeOverListener(
|
||||||
(function() { this.gameOver(); }).bind(this)
|
(function() { this.timeOver(); }).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
// keyboard shortcut
|
// keyboard shortcut
|
||||||
@@ -134,14 +136,34 @@ var Game = {
|
|||||||
this.alienTimer.start();
|
this.alienTimer.start();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
timeOver: function() {
|
||||||
|
var timeOverText = new TimeOverText();
|
||||||
|
this.stopAndGoResult();
|
||||||
|
},
|
||||||
|
|
||||||
gameOver: function() {
|
gameOver: function() {
|
||||||
|
var gameOverText = new GameOverText();
|
||||||
|
this.updateResultRecord();
|
||||||
|
this.stopAndGoResult();
|
||||||
|
},
|
||||||
|
|
||||||
|
stopAndGoResult: function() {
|
||||||
this.alienTimer.stop();
|
this.alienTimer.stop();
|
||||||
|
|
||||||
var gameOverText = new GameOverText();
|
|
||||||
|
|
||||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
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() {
|
goResult: function() {
|
||||||
location.href = '../../web/client/result.html';
|
location.href = '../../web/client/result.html';
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ var Result = {
|
|||||||
|
|
||||||
// contents
|
// contents
|
||||||
this.printRecord();
|
this.printRecord();
|
||||||
if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
|
// if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
|
||||||
this.updateResultRecord();
|
// this.updateResultRecord();
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.makeRestartButton();
|
this.makeRestartButton();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
var TypingPractice = {
|
var TypingPractice = {
|
||||||
|
|
||||||
create: function() {
|
create: function() {
|
||||||
|
this.dbConnectManager = new DBConnectManager();
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.isOnStage = false;
|
this.isOnStage = false;
|
||||||
@@ -10,7 +12,7 @@ var TypingPractice = {
|
|||||||
|
|
||||||
var experienceAppTimer = new ExperienceAppTimer();
|
var experienceAppTimer = new ExperienceAppTimer();
|
||||||
experienceAppTimer.setTimeOverListener(
|
experienceAppTimer.setTimeOverListener(
|
||||||
(function() { this.gameOver(); }).bind(this)
|
(function() { this.timeOver(); }).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
game.stage.backgroundColor = '#4d4d4d';
|
game.stage.backgroundColor = '#4d4d4d';
|
||||||
@@ -26,7 +28,7 @@ var TypingPractice = {
|
|||||||
self.isOnStage = false;
|
self.isOnStage = false;
|
||||||
|
|
||||||
// self.goResult();
|
// self.goResult();
|
||||||
self.gameOver();
|
self.timeOver();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
@@ -130,7 +132,7 @@ var TypingPractice = {
|
|||||||
this.moveHands();
|
this.moveHands();
|
||||||
},
|
},
|
||||||
|
|
||||||
gameOver: function() {
|
timeOver: function() {
|
||||||
this.isOnStage = false;
|
this.isOnStage = false;
|
||||||
|
|
||||||
for(var i = 0; i < TypingPractice.TYPING_CONTENT_DONE_COUNT; i++) {
|
for(var i = 0; i < TypingPractice.TYPING_CONTENT_DONE_COUNT; i++) {
|
||||||
@@ -151,14 +153,26 @@ var TypingPractice = {
|
|||||||
this.rightHand.moveToDefaultPosition();
|
this.rightHand.moveToDefaultPosition();
|
||||||
|
|
||||||
this.animalList.stopAnimation();
|
this.animalList.stopAnimation();
|
||||||
|
var timeOverText = new TimeOverText();
|
||||||
|
|
||||||
|
sessionStorageManager.setRecord(this.typingScore.getScore());
|
||||||
|
this.updateResultRecord();
|
||||||
|
|
||||||
var gameOverText = new GameOverText();
|
|
||||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
goResult: function() {
|
updateResultRecord: function() {
|
||||||
sessionStorageManager.setRecord(this.typingScore.getScore());
|
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';
|
location.href = '../../web/client/result.html';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
var TypingTest = {
|
var TypingTest = {
|
||||||
|
|
||||||
create: function() {
|
create: function() {
|
||||||
|
this.dbConnectManager = new DBConnectManager();
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.initTypingData();
|
this.initTypingData();
|
||||||
@@ -8,7 +10,7 @@ var TypingTest = {
|
|||||||
|
|
||||||
var experienceAppTimer = new ExperienceAppTimer();
|
var experienceAppTimer = new ExperienceAppTimer();
|
||||||
experienceAppTimer.setTimeOverListener(
|
experienceAppTimer.setTimeOverListener(
|
||||||
(function() { this.gameOver(); }).bind(this)
|
(function() { this.timeOver(); }).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
game.stage.backgroundColor = '#4d4d4d';
|
game.stage.backgroundColor = '#4d4d4d';
|
||||||
@@ -164,20 +166,42 @@ var TypingTest = {
|
|||||||
this.showPlayingWordNumber();
|
this.showPlayingWordNumber();
|
||||||
},
|
},
|
||||||
|
|
||||||
gameOver: function() {
|
timeOver: function() {
|
||||||
var gameOverText = new GameOverText();
|
var timeOverText = new TimeOverText();
|
||||||
|
this.stopAndGoResult();
|
||||||
|
},
|
||||||
|
|
||||||
|
gameOver: function() {
|
||||||
|
var missionClearText = new MissionClearText();
|
||||||
|
this.stopAndGoResult();
|
||||||
|
},
|
||||||
|
|
||||||
|
stopAndGoResult: function() {
|
||||||
this.animalList.stopAnimation();
|
this.animalList.stopAnimation();
|
||||||
|
|
||||||
|
sessionStorageManager.setRecord(this.typingRecordTotal);
|
||||||
|
if(!isExperienceMaestroAccount())
|
||||||
|
this.updateResultRecord();
|
||||||
|
|
||||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
goResult: function() {
|
updateResultRecord: function() {
|
||||||
sessionStorageManager.setRecord(this.typingRecordTotal);
|
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';
|
location.href = '../../web/client/result.html';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
initTypingData: function() {
|
initTypingData: function() {
|
||||||
var typingTextMan = new TypingTextManager();
|
var typingTextMan = new TypingTextManager();
|
||||||
|
|
||||||
@@ -333,7 +357,8 @@ var TypingTest = {
|
|||||||
this.playNextContent();
|
this.playNextContent();
|
||||||
|
|
||||||
if(this.typingIndex == this.typingContentLength)
|
if(this.typingIndex == this.typingContentLength)
|
||||||
this.goResult();
|
this.gameOver();
|
||||||
|
// this.goResult();
|
||||||
// this.state.start('TypingTestResult');
|
// this.state.start('TypingTestResult');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
var WhacAMole = {
|
var WhacAMole = {
|
||||||
|
|
||||||
create: function() {
|
create: function() {
|
||||||
|
this.dbConnectManager = new DBConnectManager();
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.isOnStage = false;
|
this.isOnStage = false;
|
||||||
@@ -10,7 +12,7 @@ var WhacAMole = {
|
|||||||
|
|
||||||
var experienceAppTimer = new ExperienceAppTimer();
|
var experienceAppTimer = new ExperienceAppTimer();
|
||||||
experienceAppTimer.setTimeOverListener(
|
experienceAppTimer.setTimeOverListener(
|
||||||
(function() { this.gameOver(); }).bind(this)
|
(function() { this.timeOver(); }).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
game.stage.backgroundColor = '#4d4d4d';
|
game.stage.backgroundColor = '#4d4d4d';
|
||||||
@@ -45,7 +47,7 @@ var WhacAMole = {
|
|||||||
self.isOnStage = false;
|
self.isOnStage = false;
|
||||||
|
|
||||||
// self.goResult();
|
// self.goResult();
|
||||||
self.gameOver();
|
self.timeOver();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
@@ -155,7 +157,7 @@ var WhacAMole = {
|
|||||||
this.showHighlightKey();
|
this.showHighlightKey();
|
||||||
},
|
},
|
||||||
|
|
||||||
gameOver: function() {
|
timeOver: function() {
|
||||||
this.isOnStage = false;
|
this.isOnStage = false;
|
||||||
|
|
||||||
for(var i = 0; i < WhacAMole.TYPING_CONTENT_DONE_COUNT; i++) {
|
for(var i = 0; i < WhacAMole.TYPING_CONTENT_DONE_COUNT; i++) {
|
||||||
@@ -173,13 +175,27 @@ var WhacAMole = {
|
|||||||
this.textTypingContentPreview[i].text = "";
|
this.textTypingContentPreview[i].text = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
var gameOverText = new GameOverText();
|
var timeOverText = new TimeOverText();
|
||||||
|
|
||||||
|
sessionStorageManager.setRecord(this.scoreManager.getScore());
|
||||||
|
if(!isExperienceMaestroAccount())
|
||||||
|
this.updateResultRecord();
|
||||||
|
|
||||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
goResult: function() {
|
updateResultRecord: function() {
|
||||||
sessionStorageManager.setRecord(this.scoreManager.getScore());
|
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';
|
location.href = '../../web/client/result.html';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<script src="../../game/lib/util/record_util.js"></script>
|
<script src="../../game/lib/util/record_util.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/time_over_text.js?update_date=191225"></script>
|
||||||
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<script src="../../game/mouse/card_matching/dude_card.js"></script>
|
<script src="../../game/mouse/card_matching/dude_card.js"></script>
|
||||||
<script src="../../game/mouse/card_matching/plus_score.js"></script>
|
<script src="../../game/mouse/card_matching/plus_score.js"></script>
|
||||||
|
|
||||||
<script src="../../game/mouse/card_matching/game.js"></script>
|
<script src="../../game/mouse/card_matching/game.js?update_date=191225"></script>
|
||||||
<script src="../../game/mouse/card_matching/main.js"></script>
|
<script src="../../game/mouse/card_matching/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
<script src="../../game/lib/util/record_util.js"></script>
|
<script src="../../game/lib/util/record_util.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
||||||
|
<script src="../../game/lib/text/time_over_text.js?update_date=191225"></script>
|
||||||
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
||||||
@@ -65,7 +66,7 @@
|
|||||||
<script src="../../game/mouse/dodge/spaceship.js"></script>
|
<script src="../../game/mouse/dodge/spaceship.js"></script>
|
||||||
<script src="../../game/mouse/dodge/missile.js"></script>
|
<script src="../../game/mouse/dodge/missile.js"></script>
|
||||||
<script src="../../game/mouse/dodge/stop_watch.js"></script>
|
<script src="../../game/mouse/dodge/stop_watch.js"></script>
|
||||||
<script src="../../game/mouse/dodge/game.js"></script>
|
<script src="../../game/mouse/dodge/game.js?update_date=191225"></script>
|
||||||
<script src="../../game/mouse/dodge/main.js"></script>
|
<script src="../../game/mouse/dodge/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<script src="../../game/lib/util/record_util.js"></script>
|
<script src="../../game/lib/util/record_util.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/time_over_text.js?update_date=191225"></script>
|
||||||
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
<script src="../../game/mouse/grilled_meat/plus_score.js"></script>
|
<script src="../../game/mouse/grilled_meat/plus_score.js"></script>
|
||||||
<script src="../../game/mouse/grilled_meat/speech_bubble.js"></script>
|
<script src="../../game/mouse/grilled_meat/speech_bubble.js"></script>
|
||||||
|
|
||||||
<script src="../../game/mouse/grilled_meat/game.js"></script>
|
<script src="../../game/mouse/grilled_meat/game.js?update_date=191225"></script>
|
||||||
<script src="../../game/mouse/grilled_meat/main.js"></script>
|
<script src="../../game/mouse/grilled_meat/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
<script src="../../game/result/history_board.js"></script>
|
<script src="../../game/result/history_board.js"></script>
|
||||||
<script src="../../game/result/ranking_board.js"></script>
|
<script src="../../game/result/ranking_board.js"></script>
|
||||||
<script src="../../game/result/record_board.js"></script>
|
<script src="../../game/result/record_board.js"></script>
|
||||||
<script src="../../game/result/result.js"></script>
|
<script src="../../game/result/result.js?update_date=191225"></script>
|
||||||
<script src="../../game/result/main.js"></script>
|
<script src="../../game/result/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
<script src="../../game/lib/util/record_util.js"></script>
|
<script src="../../game/lib/util/record_util.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
||||||
|
<script src="../../game/lib/text/time_over_text.js?update_date=191225"></script>
|
||||||
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
||||||
@@ -66,7 +67,7 @@
|
|||||||
<script src="../../game/mouse/space_invaders/loading.js"></script>
|
<script src="../../game/mouse/space_invaders/loading.js"></script>
|
||||||
<script src="../../game/mouse/space_invaders/alien.js"></script>
|
<script src="../../game/mouse/space_invaders/alien.js"></script>
|
||||||
<script src="../../game/mouse/space_invaders/alien_timer.js"></script>
|
<script src="../../game/mouse/space_invaders/alien_timer.js"></script>
|
||||||
<script src="../../game/mouse/space_invaders/game.js"></script>
|
<script src="../../game/mouse/space_invaders/game.js?update_date=191225"></script>
|
||||||
<script src="../../game/mouse/space_invaders/main.js"></script>
|
<script src="../../game/mouse/space_invaders/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
<script src="../../game/lib/util/record_util.js"></script>
|
<script src="../../game/lib/util/record_util.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/time_over_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/screen_bottom_ui.js?update_date=191224"></script>
|
<script src="../../game/lib/text/screen_bottom_ui.js?update_date=191224"></script>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
<script src="../../game/typing/practice/define_variables.js"></script>
|
<script src="../../game/typing/practice/define_variables.js"></script>
|
||||||
<script src="../../game/typing/practice/typing_score.js"></script>
|
<script src="../../game/typing/practice/typing_score.js"></script>
|
||||||
<script src="../../game/typing/practice/loading.js"></script>
|
<script src="../../game/typing/practice/loading.js"></script>
|
||||||
<script src="../../game/typing/practice/game.js"></script>
|
<script src="../../game/typing/practice/game.js?update_date=191225"></script>
|
||||||
<script src="../../game/typing/practice/main.js"></script>
|
<script src="../../game/typing/practice/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,8 @@
|
|||||||
<script src="../../game/lib/util/record_util.js"></script>
|
<script src="../../game/lib/util/record_util.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/time_over_text.js?update_date=191225"></script>
|
||||||
|
<script src="../../game/lib/text/mission_clear_text.js?update_date=191225"></script>
|
||||||
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/screen_bottom_ui.js?update_date=191224"></script>
|
<script src="../../game/lib/text/screen_bottom_ui.js?update_date=191224"></script>
|
||||||
|
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
<script src="../../game/typing/test/define_variables.js"></script>
|
<script src="../../game/typing/test/define_variables.js"></script>
|
||||||
<script src="../../game/typing/test/loading.js"></script>
|
<script src="../../game/typing/test/loading.js"></script>
|
||||||
<script src="../../game/typing/test/average_typing_speed.js"></script>
|
<script src="../../game/typing/test/average_typing_speed.js"></script>
|
||||||
<script src="../../game/typing/test/game.js"></script>
|
<script src="../../game/typing/test/game.js?update_date=191225"></script>
|
||||||
<script src="../../game/typing/test/main.js"></script>
|
<script src="../../game/typing/test/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
<script src="../../game/lib/util/record_util.js"></script>
|
<script src="../../game/lib/util/record_util.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/time_over_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
|
||||||
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<script src="../../game/typing/whac_a_mole/mole.js"></script>
|
<script src="../../game/typing/whac_a_mole/mole.js"></script>
|
||||||
<script src="../../game/typing/whac_a_mole/hammer.js"></script>
|
<script src="../../game/typing/whac_a_mole/hammer.js"></script>
|
||||||
<script src="../../game/typing/whac_a_mole/loading.js"></script>
|
<script src="../../game/typing/whac_a_mole/loading.js"></script>
|
||||||
<script src="../../game/typing/whac_a_mole/game.js"></script>
|
<script src="../../game/typing/whac_a_mole/game.js?update_date=191225"></script>
|
||||||
<script src="../../game/typing/whac_a_mole/main.js"></script>
|
<script src="../../game/typing/whac_a_mole/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user