Fix: add basic left, right key to english typing practice
This commit is contained in:
@@ -41,6 +41,11 @@ ScoreText.prototype.destroySelf = function() {
|
||||
}
|
||||
|
||||
|
||||
ScoreText.prototype.setScale = function(value) {
|
||||
this.scale.set(value);
|
||||
}
|
||||
|
||||
|
||||
ScoreText.DEFAULT_TEXT_FONT = {
|
||||
font: "30px Arial",
|
||||
boundsAlignH: "center", // left, center. right
|
||||
|
||||
@@ -33,6 +33,10 @@ TypingTextManager.prototype.fillLeftRightBasicKey = function() {
|
||||
this.contents.splice(i + 1, 0, "ㅓ");
|
||||
} else if(this.isKoreanVowel(char)) {
|
||||
this.contents.splice(i, 0, "ㄹ");
|
||||
} else if(this.isEnglishLeftHand(char)) {
|
||||
this.contents.splice(i + 1, 0, "j");
|
||||
} else if(this.isEnglishRightHand(char)) {
|
||||
this.contents.splice(i, 0, "f");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,20 +45,45 @@ TypingTextManager.prototype.isKoreanConsonant = function(char) {
|
||||
if(char.length != 1)
|
||||
return false;
|
||||
|
||||
if(TypingTextManager.rCho.indexOf(char) > -1)
|
||||
if(TypingTextManager.KOREAN_LETTER_CHO.indexOf(char) > -1)
|
||||
return true;
|
||||
else if(TypingTextManager.rJong.indexOf(char) > -1)
|
||||
else if(TypingTextManager.KOREAN_LETTER_JONG.indexOf(char) > -1)
|
||||
return;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.isKoreanVowel = function(char) {
|
||||
if(char.length != 1)
|
||||
return false;
|
||||
|
||||
if(TypingTextManager.rJung.indexOf(char) > -1)
|
||||
if(TypingTextManager.KOREAN_LETTER_JUNG.indexOf(char) > -1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.isEnglishLeftHand = function(char) {
|
||||
if(char.length != 1)
|
||||
return false;
|
||||
|
||||
if(TypingTextManager.ENGLISH_LETTER_LEFT.indexOf(char) > -1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.isEnglishRightHand = function(char) {
|
||||
if(char.length != 1)
|
||||
return false;
|
||||
|
||||
if(TypingTextManager.ENGLISH_LETTER_RIGHT.indexOf(char) > -1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
TypingTextManager.prototype.makePracticeContents = function(arr, repeatCount) {
|
||||
this.init();
|
||||
this.add(arr);
|
||||
@@ -76,13 +105,30 @@ TypingTextManager.shuffledArray = function(arr) {
|
||||
}
|
||||
|
||||
|
||||
TypingTextManager.rCho =
|
||||
[ "ㄱ", "ㄲ", "ㄴ", "ㄷ", "ㄸ", "ㄹ", "ㅁ", "ㅂ", "ㅃ", "ㅅ", "ㅆ", "ㅇ", "ㅈ", "ㅉ",
|
||||
"ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ" ];
|
||||
TypingTextManager.rJung =
|
||||
[ "ㅏ", "ㅐ", "ㅑ", "ㅒ", "ㅓ", "ㅔ", "ㅕ", "ㅖ", "ㅗ", "ㅘ", "ㅙ", "ㅚ", "ㅛ", "ㅜ",
|
||||
"ㅝ", "ㅞ", "ㅟ", "ㅠ", "ㅡ", "ㅢ", "ㅣ" ];
|
||||
TypingTextManager.rJong =
|
||||
[ "", "ㄱ", "ㄲ", "ㄳ", "ㄴ", "ㄵ", "ㄶ", "ㄷ", "ㄹ", "ㄺ", "ㄻ", "ㄼ", "ㄽ", "ㄾ",
|
||||
"ㄿ", "ㅀ", "ㅁ", "ㅂ", "ㅄ", "ㅅ", "ㅆ", "ㅇ", "ㅈ", "ㅊ", "ㅋ", "ㅌ",
|
||||
"ㅍ", "ㅎ" ];
|
||||
TypingTextManager.KOREAN_LETTER_CHO = [
|
||||
"ㄱ", "ㄲ", "ㄴ", "ㄷ", "ㄸ", "ㄹ", "ㅁ", "ㅂ", "ㅃ", "ㅅ",
|
||||
"ㅆ", "ㅇ", "ㅈ", "ㅉ", "ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ"
|
||||
];
|
||||
|
||||
TypingTextManager.KOREAN_LETTER_JUNG = [
|
||||
"ㅏ", "ㅐ", "ㅑ", "ㅒ", "ㅓ", "ㅔ", "ㅕ", "ㅖ", "ㅗ", "ㅘ",
|
||||
"ㅙ", "ㅚ", "ㅛ", "ㅜ", "ㅝ", "ㅞ", "ㅟ", "ㅠ", "ㅡ", "ㅢ", "ㅣ"
|
||||
];
|
||||
|
||||
TypingTextManager.KOREAN_LETTER_JONG = [
|
||||
"", "ㄱ", "ㄲ", "ㄳ", "ㄴ", "ㄵ", "ㄶ", "ㄷ", "ㄹ", "ㄺ",
|
||||
"ㄻ", "ㄼ", "ㄽ", "ㄾ", "ㄿ", "ㅀ", "ㅁ", "ㅂ", "ㅄ", "ㅅ",
|
||||
"ㅆ", "ㅇ", "ㅈ", "ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ"
|
||||
];
|
||||
|
||||
TypingTextManager.ENGLISH_LETTER_LEFT = [
|
||||
"q", "w", "e", "r", "t",
|
||||
"a", "s", "d", "f", "g",
|
||||
"z", "x", "c", "v", "b"
|
||||
];
|
||||
|
||||
TypingTextManager.ENGLISH_LETTER_RIGHT = [
|
||||
"y", "u", "i", "o", "p",
|
||||
"h", "j", "k", "l",
|
||||
"n", "m"
|
||||
];
|
||||
|
||||
@@ -399,6 +399,7 @@ var TypingPractice = {
|
||||
TypingContentBG.POS_Y_CONTENT_BOX_TYPING_PRACTICE,
|
||||
presentScore - prevScore
|
||||
);
|
||||
scoreText.setScale(1.5);
|
||||
}
|
||||
|
||||
this.animalList.activate(this.playingAnimalIndex);
|
||||
|
||||
Reference in New Issue
Block a user