Fix: update typing record with timer
This commit is contained in:
@@ -53,13 +53,24 @@ TypingExamination.prototype.create = function() {
|
||||
if(this.textTimer === null)
|
||||
return;
|
||||
|
||||
this.textTimer.text = TimeUtil.printHHMMSSFromSec(timeLeftSec);
|
||||
var timeLeft = TimeUtil.printHHMMSSFromSec(timeLeftSec);
|
||||
if(timeLeft !== this.textTimer.text) {
|
||||
this.textTimer.text = TimeUtil.printHHMMSSFromSec(timeLeftSec);
|
||||
|
||||
this.updateCorrectUnicodeLetterCount();
|
||||
this.updateTypingRecord();
|
||||
}
|
||||
}).bind(this)
|
||||
);
|
||||
this.realtimeStageTimer.setTimeOverEvent(
|
||||
(function() {
|
||||
this.textTimer.text = "타임 오버";
|
||||
console.log("Time over");
|
||||
|
||||
this.updateCorrectUnicodeLetterCount();
|
||||
this.updateTypingRecord();
|
||||
|
||||
// this.inputTextContent.inputEnabled = false;
|
||||
}).bind(this)
|
||||
);
|
||||
|
||||
@@ -507,6 +518,20 @@ TypingExamination.prototype.onKeyUp = function(event) {
|
||||
|
||||
this.highlightTypingContent(notTrimmedInputContent, notTrimmedTypingContent);
|
||||
|
||||
this.updateCorrectUnicodeLetterCount();
|
||||
this.updateTypingRecord();
|
||||
|
||||
if(event.keyCode == Phaser.Keyboard.ENTER)
|
||||
this.onKeyEnter(trimmedInputContent, trimmedTypingContent, notTrimmedTypingContent);
|
||||
|
||||
if(event.keyCode == Phaser.Keyboard.SPACEBAR)
|
||||
this.onKeyEnter(trimmedInputContent, trimmedTypingContent, notTrimmedTypingContent);
|
||||
}
|
||||
|
||||
TypingExamination.prototype.updateCorrectUnicodeLetterCount = function() {
|
||||
var notTrimmedInputContent = this.inputTextContent.canvasInput.value();
|
||||
var notTrimmedTypingContent = this.typingExaminationContents[this.typingIndex];
|
||||
|
||||
var correctLetterCount = this.getCorrectLetterCount(notTrimmedInputContent, notTrimmedTypingContent);
|
||||
if(correctLetterCount === this.correctLetterCountInLine + 1) {
|
||||
this.correctLetterCountInLine++;
|
||||
@@ -530,14 +555,6 @@ TypingExamination.prototype.onKeyUp = function(event) {
|
||||
} else {
|
||||
// console.log("combinationing letter for " + " (" + notTrimmedInputContent[correctLetterCount] + "), correctLetterCount : " + correctLetterCount);
|
||||
}
|
||||
|
||||
this.updateTypingRecord();
|
||||
|
||||
if(event.keyCode == Phaser.Keyboard.ENTER)
|
||||
this.onKeyEnter(trimmedInputContent, trimmedTypingContent, notTrimmedTypingContent);
|
||||
|
||||
if(event.keyCode == Phaser.Keyboard.SPACEBAR)
|
||||
this.onKeyEnter(trimmedInputContent, trimmedTypingContent, notTrimmedTypingContent);
|
||||
}
|
||||
|
||||
TypingExamination.prototype.onKeyEnter = function(trimmedInputContent, trimmedTypingContent, notTrimmedTypingContent) {
|
||||
@@ -720,7 +737,7 @@ TypingExamination.prototype.setTimeTypingStart = function() {
|
||||
}
|
||||
|
||||
|
||||
TypingExamination.GAME_TIME_SEC = TimeUtil.MINUTE_SEC * 5; // 5 minutes
|
||||
TypingExamination.GAME_TIME_SEC = 3; //TimeUtil.MINUTE_SEC * 5; // 5 minutes
|
||||
|
||||
TypingExamination.SPACE_INDICATOR = "␣"; // "ˇ"; // "ᵔ"; // "ᵕ"; // "ˣ"; // "ᵛ"; // " · ";
|
||||
TypingExamination.ENTER_INDICATOR = "⏎"; // "↵"; // "↵";
|
||||
|
||||
Reference in New Issue
Block a user