From c1efb24684123563a7940c9c43142a8830dde0db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Thu, 7 Jun 2018 18:33:54 +0900 Subject: [PATCH] Fix: delete test_*.html files --- src/game/global/global_variables.js | 3 - src/game/menu/menu_app.js | 6 +- src/game/menu/menu_typing_practice.js | 4 +- src/game/start/start.js | 7 +- src/game/typing/practice/content_progress.js | 39 ++ src/game/typing/practice/define_variables.js | 0 src/game/typing/practice/game.js | 413 ++++++++++++++++++ src/game/typing/practice/loading.js | 93 ++++ src/game/typing/practice/main.js | 16 + src/game/typing/test/game.js | 6 +- src/web/client/test_english_left_lower.html | 82 ---- src/web/client/test_english_left_upper.html | 82 ---- src/web/client/test_english_right_lower.html | 82 ---- src/web/client/test_english_right_upper.html | 82 ---- .../client/test_english_second_finger.html | 82 ---- src/web/client/test_english_sentence.html | 82 ---- src/web/client/test_korean_basic.html | 80 ---- src/web/client/test_korean_left_lower.html | 82 ---- src/web/client/test_korean_left_upper.html | 82 ---- .../client/test_korean_left_upper_double.html | 82 ---- src/web/client/test_korean_right_lower.html | 82 ---- src/web/client/test_korean_right_upper.html | 82 ---- .../test_korean_right_upper_double.html | 82 ---- src/web/client/test_korean_second_finger.html | 82 ---- src/web/client/test_korean_sentence.html | 80 ---- src/web/client/test_korean_word.html | 82 ---- ...english_word.html => typing_practice.html} | 22 +- ...st_english_basic.html => typing_test.html} | 9 +- 28 files changed, 584 insertions(+), 1342 deletions(-) create mode 100644 src/game/typing/practice/content_progress.js create mode 100644 src/game/typing/practice/define_variables.js create mode 100644 src/game/typing/practice/game.js create mode 100644 src/game/typing/practice/loading.js create mode 100644 src/game/typing/practice/main.js delete mode 100644 src/web/client/test_english_left_lower.html delete mode 100644 src/web/client/test_english_left_upper.html delete mode 100644 src/web/client/test_english_right_lower.html delete mode 100644 src/web/client/test_english_right_upper.html delete mode 100644 src/web/client/test_english_second_finger.html delete mode 100644 src/web/client/test_english_sentence.html delete mode 100644 src/web/client/test_korean_basic.html delete mode 100644 src/web/client/test_korean_left_lower.html delete mode 100644 src/web/client/test_korean_left_upper.html delete mode 100644 src/web/client/test_korean_left_upper_double.html delete mode 100644 src/web/client/test_korean_right_lower.html delete mode 100644 src/web/client/test_korean_right_upper.html delete mode 100644 src/web/client/test_korean_right_upper_double.html delete mode 100644 src/web/client/test_korean_second_finger.html delete mode 100644 src/web/client/test_korean_sentence.html delete mode 100644 src/web/client/test_korean_word.html rename src/web/client/{test_english_word.html => typing_practice.html} (84%) rename src/web/client/{test_english_basic.html => typing_test.html} (96%) diff --git a/src/game/global/global_variables.js b/src/game/global/global_variables.js index 54be905..3b0e9cd 100644 --- a/src/game/global/global_variables.js +++ b/src/game/global/global_variables.js @@ -54,8 +54,6 @@ function isTypingGame() { function isTypingPracticeStage() { let appName = sessionStorageManager.playingAppName; - console.log(appName); - console.log(appName.indexOf("practice_")); if(appName.indexOf("practice_") > -1) return true; @@ -65,7 +63,6 @@ function isTypingPracticeStage() { function isTypingTestStage() { let appName = sessionStorageManager.playingAppName; - console.log(appName.indexOf("test_")); if(appName.indexOf("test_") > -1) return true; diff --git a/src/game/menu/menu_app.js b/src/game/menu/menu_app.js index f0f6733..0adafbd 100644 --- a/src/game/menu/menu_app.js +++ b/src/game/menu/menu_app.js @@ -78,9 +78,9 @@ class MenuApp { } makeTypingButtons(typingPracticeAppCount, typingTestAppCount, typingAppJSON) { - console.log(typingPracticeAppCount); - console.log(typingTestAppCount); - console.log(typingAppJSON); + // console.log(typingPracticeAppCount); + // console.log(typingTestAppCount); + // console.log(typingAppJSON); let isTypingPracticeAppExist = typingPracticeAppCount > 0 ? true : false; let isTypingTestAppExist = typingTestAppCount > 0 ? true : false; diff --git a/src/game/menu/menu_typing_practice.js b/src/game/menu/menu_typing_practice.js index edbeb34..c160012 100644 --- a/src/game/menu/menu_typing_practice.js +++ b/src/game/menu/menu_typing_practice.js @@ -65,7 +65,7 @@ class MenuTypingPractice { sessionStorageManager.playingAppID = activeApp.AppID; sessionStorageManager.playingAppName = activeApp.AppName; sessionStorageManager.playingAppKoreanName = activeApp.KoreanName; - location.href = '../../web/client/start.html'; + location.href = '../../web/client/typing_practice.html'; } ); } @@ -86,7 +86,7 @@ class MenuTypingPractice { sessionStorageManager.playingAppID = activeApp.AppID; sessionStorageManager.playingAppName = activeApp.AppName; sessionStorageManager.playingAppKoreanName = activeApp.KoreanName; - location.href = '../../web/client/start.html'; + location.href = '../../web/client/typing_practice.html'; } ); } diff --git a/src/game/start/start.js b/src/game/start/start.js index d8e87a5..03ae840 100644 --- a/src/game/start/start.js +++ b/src/game/start/start.js @@ -153,7 +153,12 @@ class Start { } startStage() { - location.href = "../../web/client/" + sessionStorageManager.playingAppName + ".html"; + if(isTypingPracticeStage()) + location.href = "../../web/client/typing_practice.html"; + else if(isTypingTestStage()) + location.href = "../../web/client/typing_test.html"; + else + location.href = "../../web/client/" + sessionStorageManager.playingAppName + ".html"; } } \ No newline at end of file diff --git a/src/game/typing/practice/content_progress.js b/src/game/typing/practice/content_progress.js new file mode 100644 index 0000000..5f3e1e8 --- /dev/null +++ b/src/game/typing/practice/content_progress.js @@ -0,0 +1,39 @@ +class ContentProgress { + + constructor() { + let fontStyle = ContentProgress.DEFAULT_TEXT_FONT; + + fontStyle.align = "right"; + fontStyle.boundsAlignH = "right"; + this.typingSpeedText = game.add.text(game.world.width - 300, 0, "", fontStyle) + .setTextBounds(0, 0, 200, ContentProgress.FONT_HEIGHT_PX); + + // var grd = this.label.context.createLinearGradient(0, 0, 0, ContentProgress.FONT_HEIGHT_PX); + // grd.addColorStop(0, '#8ED6FF'); + // grd.addColorStop(1, '#004CB3'); + // this.label.fill = grd; + // this.scoreText.fill = grd; + + // this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2); + // this.label.stroke = '#000'; + // this.label.strokeThickness = 3; + }; + + print(playingNumber, totalCount) { + if(playingNumber > totalCount) + return; + + this.typingSpeedText.text = playingNumber + " / " + totalCount; + } + +} + +ContentProgress.FONT_HEIGHT_PX = 70; + +ContentProgress.DEFAULT_TEXT_FONT = { + font: "38px Arial", + align: "center", + boundsAlignH: "center", // left, center. right + boundsAlignV: "middle", // top, middle, bottom + fill: "#fff" +}; \ No newline at end of file diff --git a/src/game/typing/practice/define_variables.js b/src/game/typing/practice/define_variables.js new file mode 100644 index 0000000..e69de29 diff --git a/src/game/typing/practice/game.js b/src/game/typing/practice/game.js new file mode 100644 index 0000000..a7aeed9 --- /dev/null +++ b/src/game/typing/practice/game.js @@ -0,0 +1,413 @@ +///////////////////////////// +// TypingPractice + +class TypingPractice { + + create() { + self = this; + + this.initTypingData(); + sessionStorageManager.isNewBestRecrd = false; + + game.stage.backgroundColor = '#4d4d4d'; + + // top + let backButton = new BackButton( () => { + sessionStorageManager.resetPlayingAppData(); + + location.href = '../../web/client/menu_typing_practice.html'; + }); + + this.contentProgressText = new ContentProgress(); + + let fullscreenButton = new FullscreenButton(game); + + + // typing content + var typingAreaPositionY = 260; + var bar = game.add.graphics(); + bar.beginFill(0x000000, 0.2); + bar.drawRect(0, typingAreaPositionY, GAME_SCREEN_SIZE.x, 120); + + if(isTypingWordStage()) + textStyleBasic.font = "bold 84px Arial"; + else // Sentence stage + textStyleBasic.font = "bold 48px Arial"; + + this.textTypingContent = game.add.text(0, 2, "test", textStyleBasic) + .setTextBounds(0, typingAreaPositionY, GAME_SCREEN_SIZE.x, 120) + .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2) + .addColor(TypingPractice.COLOR_CONTENT_WRONG, 0); + + textStyleBasic.font = "32px Arial"; + + var textDoneColor = [ '#99994d', '#77774d', '#66664d' ]; + this.textTypingContentsDone = []; + this.textTypingRecordsDone = []; + for(var i = 0; i < TypingPractice.TYPING_CONTENT_DONE_COUNT; i++) { + this.textTypingContentsDone[i] = game.add.text(0, 2, "test", textStyleBasic) + .setTextBounds(0, typingAreaPositionY - 50 - i * 50, GAME_SCREEN_SIZE.x, 40) + .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2) + .addColor(textDoneColor[i], 0); + + var scorePositionX = 780; + if(isTypingWordStage()) + scorePositionX = 600; + + this.textTypingRecordsDone[i] = game.add.text(0, 2, "", textStyleBasic) + .setTextBounds(scorePositionX, typingAreaPositionY - 50 - i * 50, 200, 40) + .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2) + .addColor(textDoneColor[i], 0); + + } + + var textPreviewColor = [ '#999999', '#888888', '#777777' ]; + this.textTypingContentPreview = []; + for(var i = 0; i < TypingPractice.TYPING_CONTENT_PREVIEW_COUNT; i++) { + this.textTypingContentPreview[i] = game.add.text(0, 2, "test", textStyleBasic) + .setTextBounds(0, typingAreaPositionY + 130 + i * 50, GAME_SCREEN_SIZE.x, 40) + .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2) + .addColor(textPreviewColor[i], 0); + } + + + // input text + this.inputTextContent = new InputTypeText(game.world.centerX, typingAreaPositionY + 360); + this.inputTextContent.anchor.set(0.5); + this.inputTextContent.canvasInput.value(''); + this.inputTextContent.canvasInput.focus(); + // inputTextContent.canvasInput._onkeydown = this.checkInputText; + // inputTextContent.canvasInput._onkeyup = function() { + this.inputTextContent.canvasInput._onkeyup = function() { + self.checkTypingContents(event); + } + + + // bottom + let screenBottom = new ScreenBottom(); + screenBottom.makeBottomLine(); + // screenBottom.printBottomLeftText(""); + screenBottom.printBottomCenterText(sessionStorageManager.playingAppKoreanName); + screenBottom.printBottomRightText(sessionStorageManager.playerName); + + + this.startGame(); + // this.countDown(); + } + + /* + countDown() { + const style = { font: "bold 200px Arial", fill: "#fff", boundsAlignH: "center", boundsAlignV: "middle" }; + this.countDownText = game.add.text(0, 0, "", style); + this.countDownText.setTextBounds(0, 0, game.world.width, game.world.height); + this.countDownText.stroke = "#333"; + this.countDownText.strokeThickness = 50; + + this.countDownNumber = 3; + if(isDebugMode()) + this.countDownNumber = 1; + this.tweenCountDown(); + } + + tweenCountDown() { + if(this.countDownNumber === 0) { + this.startGame(); + return; + } + + this.countDownText.text = this.countDownNumber.toString(); + this.countDownText.alpha = 1; + + let countDownTween = game.add.tween(this.countDownText); + countDownTween.to( { alpha: 0 }, GAME_SCREEN_SIZE.x, Phaser.Easing.Linear.None, true); + countDownTween.onComplete.add(this.tweenCountDown, this); + + this.countDownNumber--; + } + */ + + startGame() { + this.showTypingPracticeContents(); + this.showPlayingWordNumber(); + } + + gameOver() { + let gameOverText = new GameOverText(); + + game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this); + } + + goResult() { + sessionStorageManager.record = this.typingRecordTotal; + if(sessionStorageManager.record > sessionStorageManager.bestRecord) + sessionStorageManager.bestRecord = sessionStorageManager.record; + + location.href = '../../web/client/result.html'; + } + + initTypingData() { + this.typingContents = this.getTypingPracticeContents(); + var randomContents = Phaser.ArrayUtils.shuffle(this.typingContents); + this.wordCountForStage = TypingPractice.WORD_COUNT_FOR_STAGE; + if(isDebugMode()) + this.wordCountForStage = 3; + this.typingRandomContents = randomContents.slice(1, this.wordCountForStage + 1); // start Num, end Num (not index) + this.typingContentLength = this.typingContents.length; + this.typingIndex = 0; + + this.isTyping = false; + this.timeTypingStart = 0; + this.timeTypingEnd = 0; + + this.typingLetterCountTotal = 0; + this.typingRecordTotal = 0; + } + + + getTypingPracticeContents() { + var TypingPracticeContents = this.loadTestContent(); + // console.log('playingStageData.language : ' + playingStageData.language); + // console.log('playingStageData.level : ' + playingStageData.level); + // console.log('TypingPracticeContents : ' + TypingPracticeContents); + + this.typingRecordForLines = []; + this.typingElapsedTime = []; + for(var i = 0; i < TypingPracticeContents.length; i++) { + this.typingRecordForLines[i] = 0; + this.typingElapsedTime[i] = 0; + } + + return TypingPracticeContents; + } + + loadTestContent() { + let appName = ""; + if(isTypingTestStage()) + appName = sessionStorageManager.playingAppName.substring(5); + else if(isTypingPracticeStage()) + appName = sessionStorageManager.playingAppName.substring(9); + + var testContent = []; + switch(appName) { + case "korean_basic": + testContent = koreanBasicWordList; + break; + case "korean_left_upper": + testContent = koreanLeftUpperWordList; + break; + case "korean_second_finger": + testContent = koreanSecondFingerWordList; + break; + case "korean_right_upper": + testContent = koreanRightUpperWordList; + break; + case "korean_left_lower": + testContent = koreanLeftLowerWordList; + break; + case "korean_right_lower": + testContent = koreanRightLowerWordList; + break; + case "korean_left_upper_double": + testContent = koreanLeftUpperDoubleWordList; + break; + case "korean_right_upper_double": + testContent = koreanRightUpperDoubleWordList; + break; + case "korean_word": + testContent = koreanWordList; + break; + case "korean_sentence": + testContent = koreanSentenceList; + break; + + case "english_basic": + testContent = englishBasicWordList; + break; + case "english_left_upper": + testContent = englishLeftUpperWordList; + break; + case "english_second_finger": + testContent = englishSecondFingerWordList; + break; + case "english_right_upper": + testContent = englishRightUpperWordList; + break; + case "english_left_lower": + testContent = englishLeftLowerWordList; + break; + case "english_right_lower": + testContent = englishRightLowerWordList; + break; + case "english_word": + testContent = englishWordList; + break; + case "english_sentence": + testContent = englishSentenceList; + break; + } + + return testContent; + } + + showTypingPracticeContents() { + for(var i = 0; i < TypingPractice.TYPING_CONTENT_DONE_COUNT; i++) { + var doneIndex = this.typingIndex - i - 1; + if(doneIndex < 0) { + this.textTypingContentsDone[i].text = ""; + this.textTypingRecordsDone[i].text = ""; + } else { + this.textTypingContentsDone[i].text = this.typingRandomContents[doneIndex]; + this.textTypingRecordsDone[i].text = Math.floor(this.typingRecordForLines[doneIndex]); + } + } + + if(this.typingIndex == this.wordCountForStage) { + this.textTypingContent.text = ""; + return; + } + + this.textTypingContent.text = this.typingRandomContents[this.typingIndex]; + + for(var i = 0; i < TypingPractice.TYPING_CONTENT_PREVIEW_COUNT; i++) { + var previewIndex = this.typingIndex + i + 1; + if(previewIndex < this.typingRandomContents.length) + this.textTypingContentPreview[i].text = this.typingRandomContents[previewIndex]; + else + this.textTypingContentPreview[i].text = ""; + } + } + + resetTypingContent() { + this.textTypingContent.clearColors(); + this.textTypingContent.addColor(TypingPractice.COLOR_CONTENT_WRONG, 0); + this.inputTextContent.canvasInput.value(''); + } + + checkTypingContents(evnet) { + if(event.keyCode == Phaser.Keyboard.ENTER) { + // console.log("### enter ###"); + var inputContent = this.inputTextContent.canvasInput.value(); + var typingContent = this.typingRandomContents[this.typingIndex]; + + if(inputContent == typingContent) { + this.calculateTypingRecord(typingContent); + this.playNextContent(); + + if(this.typingIndex == this.wordCountForStage) + this.goResult(); + // this.state.start('TypingPracticeResult'); + } + } + else { + // console.log(this.inputTextContent.canvasInput.value()); + if(this.isTyping == false) { + // console.log(event); + this.setTimeTypingStart(); + } + + this.showTypingContentHighlight(); + } + } + + showTypingContentHighlight() { + var typingContent = this.typingRandomContents[this.typingIndex]; + var inputContent = this.inputTextContent.canvasInput.value(); + + this.textTypingContent.clearColors(); + this.textTypingContent.addColor(TypingPractice.COLOR_CONTENT_RIGHT, 0); + + if(typingContent == null) + return; + + var typingContentLength = typingContent.length; + for(var i = 0; i < typingContentLength; i++) { + // console.log("typingContent.charAt(i) : " + typingContent.charAt(i)); + // console.log("inputContent.charAt(i) : " + inputContent.charAt(i)); + + if(typingContent.charAt(i) != inputContent.charAt(i)) { + this.textTypingContent.addColor(TypingPractice.COLOR_CONTENT_WRONG, i); + return; + } + } + } + + calculateTypingRecord(typingContent) { + // console.log('입력 단어 : ' + this.typingRandomContents[this.typingIndex]); + + this.isTyping = false; + this.timeTypingEnd = game.time.elapsedSince(0); + // console.log('this.timeTypingEnd : ' + this.timeTypingEnd); + + var elapsedTimeMS = this.timeTypingEnd - this.timeTypingStart; + // console.log('elapsedTimeMS : ' + elapsedTimeMS); + + var typingContentLength = StringUtil.getUnicodeAlphabetCount(typingContent); + // console.log('typingContentLength : ' + typingContentLength); + var typingContentPlusEnterCount = typingContentLength + TypingPractice.TYPING_COUNT_PLUS_ENTER; + + var typingRecord = (typingContentPlusEnterCount + TypingPractice.TYPING_COUNT_PLUS_ENTER) * 60000 / elapsedTimeMS; + + this.typingElapsedTime[this.typingIndex] = elapsedTimeMS; + this.typingLetterCountTotal += typingContentPlusEnterCount; + this.typingRecordForLines[this.typingIndex] = typingRecord; + // console.log(this.typingRecordForLines[this.typingIndex]); + + var typingElapsedTimeTotal = 0; + for(let i = 0; i <= this.typingIndex; i++) { + // console.log('i : ' + i + ' - time : ' + this.typingElapsedTime[i]); + typingElapsedTimeTotal += this.typingElapsedTime[i]; + } + this.typingRecordTotal = this.typingLetterCountTotal * 60000 / typingElapsedTimeTotal; + // console.log(this.typingLetterCountTotal); + // console.log(typingElapsedTimeTotal); + // console.log(typingRecordTotal); + + // console.log('-------------- total --------------'); + // console.log('typingLetterCountTotal : ' + this.typingLetterCountTotal); + // console.log('typingElapsedTimeTotal : ' + typingElapsedTimeTotal); + // console.log('typingRecordTotal : ' + typingRecordTotal); + // console.log('-----------------------------------'); + } + + playNextContent() { + this.typingIndex++; + this.showTypingPracticeContents(); + this.showPlayingWordNumber(); + this.resetTypingContent(); + } + + showPlayingWordNumber() { + this.contentProgressText.print(this.typingIndex + 1, this.wordCountForStage); + } + + setTimeTypingStart() { + this.timeTypingStart = game.time.elapsedSince(0); + var timeGap = this.timeTypingStart - this.timeTypingEnd; + + if(timeGap < 50) + return; + + this.isTyping = true; + // console.log('last End : ' + this.timeTypingEnd); + // console.log('this.timeTypingStart : ' + this.timeTypingStart); + + // console.log('time gap : ' + (this.timeTypingStart - this.timeTypingEnd)); + } + +} + + +TypingPractice.TYPING_CONTENT_PREVIEW_COUNT = 3; +TypingPractice.TYPING_CONTENT_DONE_COUNT = 3; +TypingPractice.TYPING_COUNT_PLUS_ENTER = 1; + +TypingPractice.OFFSET_RIGHT_ALIGN = 10; + +TypingPractice.WORD_COUNT_FOR_STAGE = 10; +// if(isDebugMode()) +// WORD_COUNT_FOR_STAGE = 3; + +TypingPractice.COLOR_CONTENT_WRONG = "#aaaaaa"; +TypingPractice.COLOR_CONTENT_RIGHT = "#ffff4d"; + + diff --git a/src/game/typing/practice/loading.js b/src/game/typing/practice/loading.js new file mode 100644 index 0000000..16ae580 --- /dev/null +++ b/src/game/typing/practice/loading.js @@ -0,0 +1,93 @@ +///////////////////////////// +// Loading + +// var x = 32; +// var y = 80; + +class Loading { + + preload() { + // this.game.load.image('loadingbar', './image/phaser.png'); + } + + create() { + // let userID = sessionStorage.getItem("UserID"); + // console.log("userID : " + userID); + + // this.game.stage.backgroundColor = '#4d4d4d'; + + // // Progress report + // this.textProgress = game.add.text(game.world.centerX, 100, '로딩중 . . .', textStyleBasic); + // this.textProgress.anchor.setTo(0.5, 0.4); + // this.textProgress.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2); + + // // Preload bar + // this.preloadBar = this.add.sprite(game.world.centerX, game.world.centerY, 'loadingbar'); + // this.preloadBar.anchor.setTo(0.5); + // this.preloadBar.alpha = 0; + + this.game.load.onFileComplete.add(this.fileComplete, this); + this.game.load.onLoadComplete.add(this.loadComplete, this); + + this.startLoading(); + } + + startLoading() { + this.game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png'); + // this.game.load.image('a', '../../../resources/image/icon/fullscreen_white.png'); + // this.game.load.image('b', '../../../resources/image/icon/fullscreen_white.png'); + // this.game.load.image('c', '../../../resources/image/icon/fullscreen_white.png'); + // this.game.load.image('d', '../../../resources/image/icon/fullscreen_white.png'); + // this.game.load.image('a', './image/phaser.png'); + // this.game.load.image('b', './image/phaser.png'); + // this.game.load.image('c', './image/phaser.png'); + // this.game.load.image('d', './image/phaser.png'); + // this.game.load.image('e', './image/phaser.png'); + // this.game.load.image('g', './image/phaser.png'); + // this.game.load.image('e', './image/phaser.png'); + // this.game.load.image('f', './image/phaser.png'); + // this.game.load.image('g', './image/phaser.png'); + // this.game.load.image('h', './image/phaser.png'); + + // this.game.load.image('phaser', './image/phaser.png'); + // this.game.load.spritesheet('button', './image/button_basic.png', 200, 100); + // this.game.load.image('star', './image/star_particle.png'); + // this.game.load.image('medal_gold', './image/medal_gold.png'); + // this.game.load.image('medal_silver', './image/medal_silver.png'); + // this.game.load.image('medal_bronze', './image/medal_bronze.png'); + + this.game.load.start(); + } + + fileComplete(progress, cacheKey, success, totalLoaded, totalFiles) { + // this.preloadBar.alpha = progress / 100; + + // console.log('progress : ' + progress); + + // text.setText("File Complete: " + progress + "% - " + totalLoaded + " out of " + totalFiles); + + // var newImage = game.add.image(x, y, cacheKey); + // newImage.scale.set(0.3); + + // x += newImage.width + 20; + // if (x > 700) + // { + // x = 32; + // y += 332; + // } + } + + loadComplete(progress, cacheKey, success, totalLoaded, totalFiles) { + // this.preloadBar.alpha = 1; + + if(isDebugMode()) { + this.state.start('TypingPractice'); + return; + } + + this.state.start('TypingPractice'); + // this.startMenu(); + // this.startTypingTestStage(); + // this.startTypingTestResult(); + } +} diff --git a/src/game/typing/practice/main.js b/src/game/typing/practice/main.js new file mode 100644 index 0000000..ebed1d4 --- /dev/null +++ b/src/game/typing/practice/main.js @@ -0,0 +1,16 @@ +///////////////////////////// +// Main game + +const CONTENT_ID = "Typing Practice"; + +let game = new Phaser.Game( + GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y, + Phaser.CANVAS, CONTENT_ID, + this, false, false +); + +game.state.add('Loading', Loading); +game.state.start('Loading'); + +game.state.add('TypingPractice', TypingPractice); +// game.state.add('Menu', Menu); diff --git a/src/game/typing/test/game.js b/src/game/typing/test/game.js index b7174f3..4a0b8fa 100644 --- a/src/game/typing/test/game.js +++ b/src/game/typing/test/game.js @@ -188,9 +188,8 @@ class TypingTest { if(isTypingTestStage()) appName = sessionStorageManager.playingAppName.substring(5); else if(isTypingPracticeStage()) - appName = sessionStorageManager.playingAppName.substring(5); - else - appName = sessionStorageManager.playingAppName.substring(5); + appName = sessionStorageManager.playingAppName.substring(9); + var testContent = []; switch(appName) { case "korean_basic": @@ -366,7 +365,6 @@ class TypingTest { // console.log(typingElapsedTimeTotal); // console.log(typingRecordTotal); - // this.textTypingRecordTotal.text = Math.floor(typingRecordTotal); this.averageTypingSpeedText.print(Math.floor(this.typingRecordTotal)); // console.log('-------------- total --------------'); // console.log('typingLetterCountTotal : ' + this.typingLetterCountTotal); diff --git a/src/web/client/test_english_left_lower.html b/src/web/client/test_english_left_lower.html deleted file mode 100644 index 5ec7f73..0000000 --- a/src/web/client/test_english_left_lower.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_english_left_upper.html b/src/web/client/test_english_left_upper.html deleted file mode 100644 index 9c627da..0000000 --- a/src/web/client/test_english_left_upper.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_english_right_lower.html b/src/web/client/test_english_right_lower.html deleted file mode 100644 index 3694b60..0000000 --- a/src/web/client/test_english_right_lower.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_english_right_upper.html b/src/web/client/test_english_right_upper.html deleted file mode 100644 index 0184d63..0000000 --- a/src/web/client/test_english_right_upper.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_english_second_finger.html b/src/web/client/test_english_second_finger.html deleted file mode 100644 index 1812648..0000000 --- a/src/web/client/test_english_second_finger.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_english_sentence.html b/src/web/client/test_english_sentence.html deleted file mode 100644 index e5b2297..0000000 --- a/src/web/client/test_english_sentence.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_basic.html b/src/web/client/test_korean_basic.html deleted file mode 100644 index 1f17a1b..0000000 --- a/src/web/client/test_korean_basic.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_left_lower.html b/src/web/client/test_korean_left_lower.html deleted file mode 100644 index e8c2d2a..0000000 --- a/src/web/client/test_korean_left_lower.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_left_upper.html b/src/web/client/test_korean_left_upper.html deleted file mode 100644 index 0a9f84b..0000000 --- a/src/web/client/test_korean_left_upper.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_left_upper_double.html b/src/web/client/test_korean_left_upper_double.html deleted file mode 100644 index b0eb0e5..0000000 --- a/src/web/client/test_korean_left_upper_double.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_right_lower.html b/src/web/client/test_korean_right_lower.html deleted file mode 100644 index 1efe19d..0000000 --- a/src/web/client/test_korean_right_lower.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_right_upper.html b/src/web/client/test_korean_right_upper.html deleted file mode 100644 index 707f1d5..0000000 --- a/src/web/client/test_korean_right_upper.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_right_upper_double.html b/src/web/client/test_korean_right_upper_double.html deleted file mode 100644 index 1dcf105..0000000 --- a/src/web/client/test_korean_right_upper_double.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_second_finger.html b/src/web/client/test_korean_second_finger.html deleted file mode 100644 index b6ddf21..0000000 --- a/src/web/client/test_korean_second_finger.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_sentence.html b/src/web/client/test_korean_sentence.html deleted file mode 100644 index 865d897..0000000 --- a/src/web/client/test_korean_sentence.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_korean_word.html b/src/web/client/test_korean_word.html deleted file mode 100644 index 4e1cb38..0000000 --- a/src/web/client/test_korean_word.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Typing Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/src/web/client/test_english_word.html b/src/web/client/typing_practice.html similarity index 84% rename from src/web/client/test_english_word.html rename to src/web/client/typing_practice.html index ab7cdf3..5cfc9df 100644 --- a/src/web/client/test_english_word.html +++ b/src/web/client/typing_practice.html @@ -2,7 +2,7 @@ - Typing Test + Typing Practice @@ -27,9 +27,7 @@ - - - @@ -40,9 +38,7 @@ - --> - - - - - - - - + + + + + +