Add: WhacAMole typing game

This commit is contained in:
2018-10-04 16:45:47 +09:00
parent 740115ee53
commit 72c8b9e1f4
28 changed files with 1136 additions and 112 deletions
-28
View File
@@ -45,13 +45,6 @@ HistoryBoard.prototype.calcDate = function(daysBefore) {
HistoryBoard.prototype.printRecord = function(index, date, bestRecord) {
if(sessionStorageManager.getPlayingAppName().indexOf("typing") < 0)
this.printMouseAppHistory(index, date, bestRecord);
else
this.printTypingAppHistory(index, date, appName, bestRecord);
}
HistoryBoard.prototype.printMouseAppHistory = function(index, date, bestRecord) {
var posX = 60;
var posY = game.world.height / 2 + 90 + 30 * index;
@@ -68,27 +61,6 @@ HistoryBoard.prototype.printMouseAppHistory = function(index, date, bestRecord)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
}
HistoryBoard.prototype.printTypingAppHistory = function(index, date, appName, bestRecord) {
var posX = 60;
var posY = game.world.height / 2 + 90 + 30 * index;
var style = { font: "20px Arial", fill: "#ffc", align: "right", boundsAlignH: "right", boundsAlignV: "top" };
style.boundsAlignH = "center";
game.add.text(posX, posY, date, style)
.setTextBounds(0, 0, 40, 40)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
game.add.text(posX + 60, posY, appName, style)
.setTextBounds(0, 0, 60, 60)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
style.boundsAlignH = "right";
game.add.text(posX + 120, posY, StringUtil.getRecordTextWithoutUnit(bestRecord), style)
.setTextBounds(0, 0, 80, 60)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
}
HistoryBoard.prototype.printSample = function() {
this.printRecord(0, DateUtil.getYYYYMMDD(this.calcDate(2)), 1270);
this.printRecord(1, DateUtil.getYYYYMMDD(this.calcDate(3)), 1150);
+17 -7
View File
@@ -3,7 +3,8 @@ var Result = {
preload: function() {
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
Animal.loadResources();
if(isTypingPracticeApp() || isTypingTestApp())
Animal.loadResources();
RankingBoard.loadResources();
game.load.image('star', '../../../resources/image/ui/star_particle.png');
@@ -67,10 +68,12 @@ var Result = {
var record = NumberUtil.numberWithCommas(Math.floor(sessionStorageManager.getRecord()));
style.font = "80px Arial";
if(sessionStorageManager.getPlayingAppID() < 100) {
// if(sessionStorageManager.getPlayingAppID() < 100) {
if(isTypingPracticeApp() || isTypingTestApp()) {
var leftAnimal = new Animal(Animal.TYPE_ANIMATION, game.world.centerX - 200, 150);
var animalLevelID = 0;
if(sessionStorageManager.getPlayingAppID() < 20)
// if(sessionStorageManager.getPlayingAppID() < 20)
if(isTypingPracticeApp())
animalLevelID = Animal.animalLevelIDByRecord(sessionStorageManager.getRecord(), Animal.TYPE_PRACTICE);
else
animalLevelID = Animal.animalLevelIDByRecord(sessionStorageManager.getRecord(), Animal.TYPE_TEST);
@@ -147,14 +150,21 @@ var Result = {
var startButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "다시 시작", this.restartStage);
},
restartStage: function() {
if(sessionStorageManager.getPlayingAppName().indexOf("practice_") == 0) {
location.href = "../../web/client/" + getGameAppName() + ".html";
/*
if(isTypingPracticeApp())
location.href = "../../web/client/typing_practice.html";
} else if(sessionStorageManager.getPlayingAppName().indexOf("test_") == 0) {
else if(isTypingTestApp())
location.href = "../../web/client/typing_test.html";
} else {
else if(isTypingGameApp())
location.href = "../../web/client/" + this.getGameAppName() + ".html";
// else if(isMouseGameApp())
// location.href = "../../web/client/" + this.getGameAppName() + ".html";
else
location.href = "../../web/client/" + sessionStorageManager.getPlayingAppName() + ".html";
}
*/
}
}