Fix: apply Nanum Coding font, change animal(incompleted)
This commit is contained in:
@@ -1,32 +1,17 @@
|
|||||||
TypingExamination.prototype = Object.create(Phaser.State.prototype);
|
TypingExamination.prototype = Object.create(Phaser.State.prototype);
|
||||||
TypingExamination.constructor = TypingExamination;
|
TypingExamination.constructor = TypingExamination;
|
||||||
|
|
||||||
|
|
||||||
TypingExamination.GAME_TIME_SEC = 60 * 5; // 5 minutes
|
|
||||||
|
|
||||||
TypingExamination.SPACE_INDICATOR = "ˇ"; // "ᵔ"; // "ᵕ"; // "ˣ"; // "ᵛ"; // " · ";
|
|
||||||
|
|
||||||
TypingExamination.TYPING_CONTENT_PREVIEW_COUNT = 4; // 3;
|
|
||||||
TypingExamination.TYPING_CONTENT_DONE_COUNT = 4; // 3;
|
|
||||||
TypingExamination.TYPING_COUNT_PLUS_ENTER = 1;
|
|
||||||
|
|
||||||
TypingExamination.OFFSET_RIGHT_ALIGN = 10;
|
|
||||||
|
|
||||||
TypingExamination.WORD_COUNT_FOR_STAGE = 10;
|
|
||||||
|
|
||||||
TypingExamination.COLOR_CONTENT_INPUT = "#dddddd";
|
|
||||||
TypingExamination.COLOR_CONTENT_RIGHT = "#ffff4d";
|
|
||||||
|
|
||||||
TypingExamination.STAGE_BACKGROUND_COLOR = "#4d4d4d";
|
|
||||||
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR = "#333333";
|
|
||||||
TypingExamination.STAGE_BACKGROUND_COLOR_HEX = 0x4d4d4d;
|
|
||||||
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR_HEX = 0x333333;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function TypingExamination() {
|
function TypingExamination() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TypingExamination.prototype.preload = function() {
|
||||||
|
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
||||||
|
|
||||||
|
Animal.loadResources();
|
||||||
|
|
||||||
|
game.load.script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
|
||||||
|
}
|
||||||
|
|
||||||
TypingExamination.prototype.create = function() {
|
TypingExamination.prototype.create = function() {
|
||||||
// for developing
|
// for developing
|
||||||
// sessionStorageManager.setMaestroName("삼화초");
|
// sessionStorageManager.setMaestroName("삼화초");
|
||||||
@@ -75,8 +60,21 @@ TypingExamination.prototype.create = function() {
|
|||||||
this.averageTypingSpeedText = new AverageTypingSpeed();
|
this.averageTypingSpeedText = new AverageTypingSpeed();
|
||||||
|
|
||||||
|
|
||||||
|
// bottom ui
|
||||||
|
var screenBottomUI = new ScreenBottomUI();
|
||||||
|
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
|
||||||
|
screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
|
||||||
|
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
|
||||||
|
|
||||||
|
// this.countDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
TypingExamination.prototype.fontLoaded = function() {
|
||||||
|
// this.animalList = new AnimalList(90);
|
||||||
|
this.makeAnimalRecordList();
|
||||||
|
// this.animalRecordList.hide();
|
||||||
|
this.animalRecordList.applyLoadedFont();
|
||||||
|
|
||||||
this.animalList = new AnimalList(90);
|
|
||||||
|
|
||||||
// typing content
|
// typing content
|
||||||
var CONTENT_TEXT_WIDTH = 800;
|
var CONTENT_TEXT_WIDTH = 800;
|
||||||
@@ -89,7 +87,7 @@ TypingExamination.prototype.create = function() {
|
|||||||
|
|
||||||
|
|
||||||
var TYPING_CONTENT_X = 50;
|
var TYPING_CONTENT_X = 50;
|
||||||
var TYPING_CONTENT_Y = 390;
|
var TYPING_CONTENT_Y = 320; // 390;
|
||||||
var RECORD_POSITION_X = 990;
|
var RECORD_POSITION_X = 990;
|
||||||
|
|
||||||
var INPUT_TEXT_OFFSET_X = 10;
|
var INPUT_TEXT_OFFSET_X = 10;
|
||||||
@@ -104,7 +102,7 @@ TypingExamination.prototype.create = function() {
|
|||||||
|
|
||||||
|
|
||||||
// current text
|
// current text
|
||||||
textStyleBasic.font = "38px Courier New";
|
textStyleBasic.font = "38px Nanum Gothic Coding";
|
||||||
this.textTypedContentBack = game.add.text(
|
this.textTypedContentBack = game.add.text(
|
||||||
TYPING_CONTENT_X, TYPING_CONTENT_Y,
|
TYPING_CONTENT_X, TYPING_CONTENT_Y,
|
||||||
"", textStyleBasic
|
"", textStyleBasic
|
||||||
@@ -177,7 +175,7 @@ TypingExamination.prototype.create = function() {
|
|||||||
TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT + CONTENT_UNDERLINE_OFFSET
|
TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT + CONTENT_UNDERLINE_OFFSET
|
||||||
);
|
);
|
||||||
|
|
||||||
textStyleBasic.font = "38px Courier New";
|
textStyleBasic.font = "38px Nanum Gothic Coding";
|
||||||
this.textTypingContentsDone[i] = game.add.text(
|
this.textTypingContentsDone[i] = game.add.text(
|
||||||
TYPING_CONTENT_X, TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT,
|
TYPING_CONTENT_X, TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT,
|
||||||
"", textStyleBasic
|
"", textStyleBasic
|
||||||
@@ -212,7 +210,7 @@ TypingExamination.prototype.create = function() {
|
|||||||
TYPING_CONTENT_Y + TYPING_OFFSET_Y + TYPING_PREVIEW_OFFSET_Y + i * TYPING_TEXT_OFFSET_HEIGHT + CONTENT_UNDERLINE_OFFSET
|
TYPING_CONTENT_Y + TYPING_OFFSET_Y + TYPING_PREVIEW_OFFSET_Y + i * TYPING_TEXT_OFFSET_HEIGHT + CONTENT_UNDERLINE_OFFSET
|
||||||
);
|
);
|
||||||
|
|
||||||
textStyleBasic.font = "38px Courier New";
|
textStyleBasic.font = "38px Nanum Gothic Coding";
|
||||||
this.textTypingContentPreview[i] = game.add.text(
|
this.textTypingContentPreview[i] = game.add.text(
|
||||||
TYPING_CONTENT_X,
|
TYPING_CONTENT_X,
|
||||||
TYPING_CONTENT_Y + TYPING_OFFSET_Y + TYPING_PREVIEW_OFFSET_Y + i * TYPING_TEXT_OFFSET_HEIGHT,
|
TYPING_CONTENT_Y + TYPING_OFFSET_Y + TYPING_PREVIEW_OFFSET_Y + i * TYPING_TEXT_OFFSET_HEIGHT,
|
||||||
@@ -236,8 +234,8 @@ TypingExamination.prototype.create = function() {
|
|||||||
this.inputTextContent.canvasInput.focus();
|
this.inputTextContent.canvasInput.focus();
|
||||||
this.inputTextContent.canvasInput.fontSize(BIG_FONT_SIZE);
|
this.inputTextContent.canvasInput.fontSize(BIG_FONT_SIZE);
|
||||||
// this.inputTextContent.canvasInput.fontWeight("");
|
// this.inputTextContent.canvasInput.fontWeight("");
|
||||||
this.inputTextContent.canvasInput.fontFamily("Courier New");
|
this.inputTextContent.canvasInput.fontFamily("Nanum Gothic Coding");
|
||||||
// this.inputTextContent.canvasInput.fontFamily("Courier New");
|
// this.inputTextContent.canvasInput.fontFamily("Nanum Gothic Coding");
|
||||||
this.inputTextContent.canvasInput.placeHolder("");
|
this.inputTextContent.canvasInput.placeHolder("");
|
||||||
// inputTextContent.canvasInput._onkeydown = this.checkInputText;
|
// inputTextContent.canvasInput._onkeydown = this.checkInputText;
|
||||||
// inputTextContent.canvasInput._onkeyup = function() {
|
// inputTextContent.canvasInput._onkeyup = function() {
|
||||||
@@ -247,17 +245,7 @@ TypingExamination.prototype.create = function() {
|
|||||||
// : checkTypingContents is called onkeyup and onkeydown
|
// : checkTypingContents is called onkeyup and onkeydown
|
||||||
}).bind(this);
|
}).bind(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// bottom ui
|
|
||||||
var screenBottomUI = new ScreenBottomUI();
|
|
||||||
screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
|
|
||||||
screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
|
|
||||||
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
|
|
||||||
|
|
||||||
|
|
||||||
this.loadExaminationContent();
|
this.loadExaminationContent();
|
||||||
// this.countDown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -291,6 +279,11 @@ tweenCountDown() {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
TypingExamination.prototype.makeAnimalRecordList = function() {
|
||||||
|
this.animalRecordList = new AnimalRecordList(AnimalRecordList.TYPE_MENU);
|
||||||
|
this.animalRecordList.printScore(Animal.TYPE_PRACTICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TypingExamination.prototype.back = function() {
|
TypingExamination.prototype.back = function() {
|
||||||
sessionStorageManager.resetPlayingAppData();
|
sessionStorageManager.resetPlayingAppData();
|
||||||
@@ -629,7 +622,6 @@ TypingExamination.prototype.setTimeTypingStart = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
TypingExamination.GAME_TIME_SEC = 60 * 5; // 5 minutes
|
TypingExamination.GAME_TIME_SEC = 60 * 5; // 5 minutes
|
||||||
|
|
||||||
TypingExamination.SPACE_INDICATOR = "ˇ"; // "ᵔ"; // "ᵕ"; // "ˣ"; // "ᵛ"; // " · ";
|
TypingExamination.SPACE_INDICATOR = "ˇ"; // "ᵔ"; // "ᵕ"; // "ˣ"; // "ᵛ"; // " · ";
|
||||||
@@ -648,5 +640,4 @@ TypingExamination.COLOR_CONTENT_RIGHT = "#ffff4d";
|
|||||||
TypingExamination.STAGE_BACKGROUND_COLOR = "#4d4d4d";
|
TypingExamination.STAGE_BACKGROUND_COLOR = "#4d4d4d";
|
||||||
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR = "#333333";
|
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR = "#333333";
|
||||||
TypingExamination.STAGE_BACKGROUND_COLOR_HEX = 0x4d4d4d;
|
TypingExamination.STAGE_BACKGROUND_COLOR_HEX = 0x4d4d4d;
|
||||||
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR_HEX = 0x333333;
|
TypingExamination.INPUT_CONTENT_BACKGROUND_COLOR_HEX = 0x333333;
|
||||||
*/
|
|
||||||
@@ -29,10 +29,11 @@ WebFontConfig = {
|
|||||||
|
|
||||||
|
|
||||||
var typingExamination = new TypingExamination();
|
var typingExamination = new TypingExamination();
|
||||||
game.state.add('Loading', Loading);
|
// game.state.add('Loading', Loading);
|
||||||
game.state.start('Loading');
|
// game.state.start('Loading');
|
||||||
|
|
||||||
game.state.add('TypingExamination', typingExamination);
|
game.state.add('TypingExamination', typingExamination);
|
||||||
|
game.state.start('TypingExamination');
|
||||||
|
|
||||||
function fontLoaded() {
|
function fontLoaded() {
|
||||||
typingExamination.fontLoaded();
|
typingExamination.fontLoaded();
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
<script src="../../game/lib/global/global_variables.js"></script>
|
<script src="../../game/lib/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/color/main_color.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/util/string_util.js"></script>
|
<script src="../../game/lib/util/string_util.js"></script>
|
||||||
<script src="../../game/lib/util/number_util.js"></script>
|
<script src="../../game/lib/util/number_util.js"></script>
|
||||||
<script src="../../game/lib/util/record_util.js"></script>
|
<script src="../../game/lib/util/record_util.js"></script>
|
||||||
@@ -70,12 +72,17 @@
|
|||||||
<script src="../../game/typing/lib/key_button.js"></script>
|
<script src="../../game/typing/lib/key_button.js"></script>
|
||||||
<script src="../../game/typing/lib/hand.js"></script>
|
<script src="../../game/typing/lib/hand.js"></script>
|
||||||
<script src="../../game/typing/lib/keyboard.js"></script>
|
<script src="../../game/typing/lib/keyboard.js"></script>
|
||||||
-->
|
|
||||||
<script src="../../game/typing/lib/animal.js"></script>
|
<script src="../../game/typing/lib/animal.js"></script>
|
||||||
<script src="../../game/typing/lib/animal_list.js"></script>
|
<script src="../../game/typing/lib/animal_list.js"></script>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<script src="../../game/lib/animal.js"></script>
|
||||||
|
<script src="../../game/lib/animal_list.js"></script>
|
||||||
|
<script src="../../game/lib/animal_record_list.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<script src="../../game/typing/examination/define_variables.js"></script>
|
<script src="../../game/typing/examination/define_variables.js"></script>
|
||||||
<script src="../../game/typing/examination/loading.js"></script>
|
<!-- <script src="../../game/typing/examination/loading.js"></script> -->
|
||||||
<script src="../../game/typing/examination/average_typing_speed.js"></script>
|
<script src="../../game/typing/examination/average_typing_speed.js"></script>
|
||||||
<script src="../../game/typing/examination/game.js"></script>
|
<script src="../../game/typing/examination/game.js"></script>
|
||||||
<script src="../../game/typing/examination/main.js"></script>
|
<script src="../../game/typing/examination/main.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user