diff --git a/src/game/lib/text/mission_clear_text.js b/src/game/lib/text/mission_clear_text.js
new file mode 100644
index 0000000..8322124
--- /dev/null
+++ b/src/game/lib/text/mission_clear_text.js
@@ -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;
\ No newline at end of file
diff --git a/src/game/lib/text/time_over_text.js b/src/game/lib/text/time_over_text.js
new file mode 100644
index 0000000..54dce9a
--- /dev/null
+++ b/src/game/lib/text/time_over_text.js
@@ -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;
\ No newline at end of file
diff --git a/src/game/mouse/card_matching/game.js b/src/game/mouse/card_matching/game.js
index 0ba1ce3..2e9eab3 100644
--- a/src/game/mouse/card_matching/game.js
+++ b/src/game/mouse/card_matching/game.js
@@ -1,13 +1,15 @@
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)
+ (function() { this.timeOver(); }).bind(this)
);
// keyboard shortcut
@@ -47,7 +49,7 @@ var Game = {
(function() {
this.setClickEnable(false);
- this.gameOver();
+ this.timeOver();
}).bind(this)
);
@@ -540,7 +542,11 @@ var Game = {
},
- gameOver: function() {
+ timeOver: function() {
+ var timeOverText = new TimeOverText();
+ if(!isExperienceMaestroAccount())
+ this.updateResultRecord();
+
this.activatedCardColumnNo = 0;
this.activatedCardRowNo = 0;
this.initCards();
@@ -553,11 +559,20 @@ var Game = {
}
this.gameTimeEvents = [];
- 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';
},
diff --git a/src/game/mouse/dodge/game.js b/src/game/mouse/dodge/game.js
index 428f99d..c092205 100644
--- a/src/game/mouse/dodge/game.js
+++ b/src/game/mouse/dodge/game.js
@@ -5,6 +5,8 @@ var Game = {
// },
create: function() {
+ this.dbConnectManager = new DBConnectManager();
+
game.physics.enable(this, Phaser.Physics.ARCADE);
this.indexMissile = 0;
@@ -15,7 +17,7 @@ var Game = {
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
- (function() { this.gameOver(); }).bind(this)
+ (function() { this.timeOver(); }).bind(this)
);
// keyboard shortcut
@@ -39,19 +41,18 @@ var Game = {
// contents
this.spaceship = new Spaceship();
- this.aliens = [];
+ this.missiles = [];
for(var i = 0; i < Game.MAX_MISSILE_COUNT; i++) {
var alien = new Missile(this.spaceship,
(function() {
this.spaceship.alpha = 0;
this.spaceship.body.enable = false;
-
this.showExplosionParticle();
this.gameOver();
}).bind(this) // onCollisionHandler
);
- this.aliens.push(alien);
+ this.missiles.push(alien);
}
@@ -141,20 +142,45 @@ var Game = {
return;
}
- this.aliens[this.indexMissile].setActive(true);
+ this.missiles[this.indexMissile].setActive(true);
// 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() {
var gameOverText = new GameOverText();
+ this.stopAndGoResult();
+ },
+ stopAndGoResult: 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);
},
+ 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';
},
diff --git a/src/game/mouse/grilled_meat/game.js b/src/game/mouse/grilled_meat/game.js
index c81e0b1..9224606 100644
--- a/src/game/mouse/grilled_meat/game.js
+++ b/src/game/mouse/grilled_meat/game.js
@@ -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';
},
diff --git a/src/game/mouse/space_invaders/game.js b/src/game/mouse/space_invaders/game.js
index 4893977..da1b156 100644
--- a/src/game/mouse/space_invaders/game.js
+++ b/src/game/mouse/space_invaders/game.js
@@ -1,13 +1,15 @@
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)
+ (function() { this.timeOver(); }).bind(this)
);
// keyboard shortcut
@@ -134,14 +136,34 @@ var Game = {
this.alienTimer.start();
},
+ timeOver: function() {
+ var timeOverText = new TimeOverText();
+ this.stopAndGoResult();
+ },
+
gameOver: function() {
+ var gameOverText = new GameOverText();
+ this.updateResultRecord();
+ this.stopAndGoResult();
+ },
+
+ stopAndGoResult: function() {
this.alienTimer.stop();
- 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';
},
diff --git a/src/game/result/result.js b/src/game/result/result.js
index 456d524..a58bc42 100644
--- a/src/game/result/result.js
+++ b/src/game/result/result.js
@@ -39,9 +39,9 @@ var Result = {
// contents
this.printRecord();
- if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
- this.updateResultRecord();
- }
+ // if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
+ // this.updateResultRecord();
+ // }
this.makeRestartButton();
diff --git a/src/game/typing/practice/game.js b/src/game/typing/practice/game.js
index 3586c5b..de108f8 100644
--- a/src/game/typing/practice/game.js
+++ b/src/game/typing/practice/game.js
@@ -1,6 +1,8 @@
var TypingPractice = {
create: function() {
+ this.dbConnectManager = new DBConnectManager();
+
var self = this;
this.isOnStage = false;
@@ -10,7 +12,7 @@ var TypingPractice = {
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
- (function() { this.gameOver(); }).bind(this)
+ (function() { this.timeOver(); }).bind(this)
);
game.stage.backgroundColor = '#4d4d4d';
@@ -26,7 +28,7 @@ var TypingPractice = {
self.isOnStage = false;
// self.goResult();
- self.gameOver();
+ self.timeOver();
}));
@@ -130,7 +132,7 @@ var TypingPractice = {
this.moveHands();
},
- gameOver: function() {
+ timeOver: function() {
this.isOnStage = false;
for(var i = 0; i < TypingPractice.TYPING_CONTENT_DONE_COUNT; i++) {
@@ -151,14 +153,26 @@ var TypingPractice = {
this.rightHand.moveToDefaultPosition();
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);
},
- goResult: function() {
- sessionStorageManager.setRecord(this.typingScore.getScore());
+ 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';
},
diff --git a/src/game/typing/test/game.js b/src/game/typing/test/game.js
index ed4fb75..910ac93 100644
--- a/src/game/typing/test/game.js
+++ b/src/game/typing/test/game.js
@@ -1,6 +1,8 @@
var TypingTest = {
create: function() {
+ this.dbConnectManager = new DBConnectManager();
+
var self = this;
this.initTypingData();
@@ -8,7 +10,7 @@ var TypingTest = {
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
- (function() { this.gameOver(); }).bind(this)
+ (function() { this.timeOver(); }).bind(this)
);
game.stage.backgroundColor = '#4d4d4d';
@@ -164,20 +166,42 @@ var TypingTest = {
this.showPlayingWordNumber();
},
- gameOver: function() {
- var gameOverText = new GameOverText();
+ timeOver: function() {
+ var timeOverText = new TimeOverText();
+ this.stopAndGoResult();
+ },
+ gameOver: function() {
+ var missionClearText = new MissionClearText();
+ this.stopAndGoResult();
+ },
+
+ stopAndGoResult: function() {
this.animalList.stopAnimation();
+ sessionStorageManager.setRecord(this.typingRecordTotal);
+ if(!isExperienceMaestroAccount())
+ this.updateResultRecord();
+
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
},
- goResult: function() {
- sessionStorageManager.setRecord(this.typingRecordTotal);
+ 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';
},
+
initTypingData: function() {
var typingTextMan = new TypingTextManager();
@@ -333,7 +357,8 @@ var TypingTest = {
this.playNextContent();
if(this.typingIndex == this.typingContentLength)
- this.goResult();
+ this.gameOver();
+ // this.goResult();
// this.state.start('TypingTestResult');
}
}
diff --git a/src/game/typing/whac_a_mole/game.js b/src/game/typing/whac_a_mole/game.js
index d77fc38..ae9efe0 100644
--- a/src/game/typing/whac_a_mole/game.js
+++ b/src/game/typing/whac_a_mole/game.js
@@ -1,6 +1,8 @@
var WhacAMole = {
create: function() {
+ this.dbConnectManager = new DBConnectManager();
+
var self = this;
this.isOnStage = false;
@@ -10,7 +12,7 @@ var WhacAMole = {
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
- (function() { this.gameOver(); }).bind(this)
+ (function() { this.timeOver(); }).bind(this)
);
game.stage.backgroundColor = '#4d4d4d';
@@ -45,7 +47,7 @@ var WhacAMole = {
self.isOnStage = false;
// self.goResult();
- self.gameOver();
+ self.timeOver();
}));
@@ -155,7 +157,7 @@ var WhacAMole = {
this.showHighlightKey();
},
- gameOver: function() {
+ timeOver: function() {
this.isOnStage = false;
for(var i = 0; i < WhacAMole.TYPING_CONTENT_DONE_COUNT; i++) {
@@ -173,13 +175,27 @@ var WhacAMole = {
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);
},
- goResult: function() {
- sessionStorageManager.setRecord(this.scoreManager.getScore());
+ 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';
},
diff --git a/src/web/client/card_matching.html b/src/web/client/card_matching.html
index adab724..76602bc 100644
--- a/src/web/client/card_matching.html
+++ b/src/web/client/card_matching.html
@@ -46,7 +46,7 @@
-
+
@@ -68,7 +68,7 @@
-
+
diff --git a/src/web/client/dodge.html b/src/web/client/dodge.html
index 9e4a4c3..c17deaf 100644
--- a/src/web/client/dodge.html
+++ b/src/web/client/dodge.html
@@ -46,6 +46,7 @@
+
@@ -65,7 +66,7 @@
-
+
diff --git a/src/web/client/grilled_meat.html b/src/web/client/grilled_meat.html
index fdf0b76..4003cc8 100644
--- a/src/web/client/grilled_meat.html
+++ b/src/web/client/grilled_meat.html
@@ -46,7 +46,7 @@
-
+
@@ -71,7 +71,7 @@
-
+
diff --git a/src/web/client/result.html b/src/web/client/result.html
index 771ff18..15501aa 100644
--- a/src/web/client/result.html
+++ b/src/web/client/result.html
@@ -43,7 +43,7 @@
-
+
diff --git a/src/web/client/space_invaders.html b/src/web/client/space_invaders.html
index 5721ecb..70f2d0c 100644
--- a/src/web/client/space_invaders.html
+++ b/src/web/client/space_invaders.html
@@ -46,6 +46,7 @@
+
@@ -66,7 +67,7 @@
-
+
diff --git a/src/web/client/typing_practice.html b/src/web/client/typing_practice.html
index 5a7cf31..36fd8af 100644
--- a/src/web/client/typing_practice.html
+++ b/src/web/client/typing_practice.html
@@ -48,7 +48,7 @@
-
+
@@ -96,7 +96,7 @@
-
+
diff --git a/src/web/client/typing_test.html b/src/web/client/typing_test.html
index 8dd1603..5e49df4 100644
--- a/src/web/client/typing_test.html
+++ b/src/web/client/typing_test.html
@@ -47,7 +47,8 @@
-
+
+
@@ -90,7 +91,7 @@
-
+
diff --git a/src/web/client/whac_a_mole.html b/src/web/client/whac_a_mole.html
index 093e3f0..998b604 100644
--- a/src/web/client/whac_a_mole.html
+++ b/src/web/client/whac_a_mole.html
@@ -48,7 +48,7 @@
-
+
@@ -101,7 +101,7 @@
-
+