Add: animal sprite sheet
This commit is contained in:
@@ -22,21 +22,67 @@ TypingTextManager.prototype.getShuffledArray = function(arr) {
|
||||
return Phaser.ArrayUtils.shuffle(arr);
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.fillLeftRightBasicKey = function() {
|
||||
var length = this.contents.length;
|
||||
// console.log(length);
|
||||
|
||||
for(var i = length - 1; i > -1; i--) {
|
||||
var char = this.contents[i];
|
||||
// console.log(char);
|
||||
if(this.isKoreanConsonant(char)) {
|
||||
this.contents.splice(i + 1, 0, "ㅏ");
|
||||
} else if(this.isKoreanVowel(char)) {
|
||||
this.contents.splice(i, 0, "ㄹ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.isKoreanConsonant = function(char) {
|
||||
if(char.length != 1)
|
||||
return false;
|
||||
|
||||
if(TypingTextManager.rCho.indexOf(char) > -1)
|
||||
return true;
|
||||
else if(TypingTextManager.rJong.indexOf(char) > -1)
|
||||
return;
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.isKoreanVowel = function(char) {
|
||||
if(char.length != 1)
|
||||
return false;
|
||||
|
||||
if(TypingTextManager.rJung.indexOf(char) > -1)
|
||||
return true;
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.makePracticeContents = function(arr, repeatCount) {
|
||||
this.init();
|
||||
this.add(arr);
|
||||
for(var i = 0; i < repeatCount; i++) {
|
||||
this.add(this.getShuffledArray(arr));
|
||||
}
|
||||
this.fillLeftRightBasicKey();
|
||||
}
|
||||
|
||||
TypingTextManager.prototype.makeTestContents = function(arr) {
|
||||
this.init();
|
||||
this.add(this.getShuffledArray(arr));
|
||||
this.add(this.getShuffledArray());
|
||||
}
|
||||
|
||||
|
||||
|
||||
TypingTextManager.shuffledArray = function(arr) {
|
||||
return Phaser.ArrayUtils.shuffle(arr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TypingTextManager.rCho =
|
||||
[ "ㄱ", "ㄲ", "ㄴ", "ㄷ", "ㄸ", "ㄹ", "ㅁ", "ㅂ", "ㅃ", "ㅅ", "ㅆ", "ㅇ", "ㅈ", "ㅉ",
|
||||
"ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ" ];
|
||||
TypingTextManager.rJung =
|
||||
[ "ㅏ", "ㅐ", "ㅑ", "ㅒ", "ㅓ", "ㅔ", "ㅕ", "ㅖ", "ㅗ", "ㅘ", "ㅙ", "ㅚ", "ㅛ", "ㅜ",
|
||||
"ㅝ", "ㅞ", "ㅟ", "ㅠ", "ㅡ", "ㅢ", "ㅣ" ];
|
||||
TypingTextManager.rJong =
|
||||
[ "", "ㄱ", "ㄲ", "ㄳ", "ㄴ", "ㄵ", "ㄶ", "ㄷ", "ㄹ", "ㄺ", "ㄻ", "ㄼ", "ㄽ", "ㄾ",
|
||||
"ㄿ", "ㅀ", "ㅁ", "ㅂ", "ㅄ", "ㅅ", "ㅆ", "ㅇ", "ㅈ", "ㅊ", "ㅋ", "ㅌ",
|
||||
"ㅍ", "ㅎ" ];
|
||||
@@ -30,13 +30,13 @@ var TypingPractice = {
|
||||
}));
|
||||
|
||||
|
||||
this.animalList = new AnimalList(100);
|
||||
|
||||
|
||||
// typing content
|
||||
var typingContentBG = new TypingContentBG();
|
||||
typingContentBG.makePracticeContentBG();
|
||||
|
||||
this.animalList = new AnimalList(100);
|
||||
|
||||
|
||||
var TYPING_CONTENT_Y = 200;
|
||||
|
||||
textStyleBasic.font = "bold 84px Times New Roman";
|
||||
@@ -405,7 +405,7 @@ TypingPractice.TYPING_COUNT_PLUS_ENTER = 1;
|
||||
|
||||
TypingPractice.OFFSET_RIGHT_ALIGN = 10;
|
||||
|
||||
TypingPractice.STAGE_TIMER_SEC = 30;
|
||||
TypingPractice.STAGE_TIMER_SEC = 60;
|
||||
|
||||
TypingPractice.COLOR_CONTENT_INPUT = "#dddddd";
|
||||
TypingPractice.COLOR_BRACKET = "#dddd70";
|
||||
|
||||
Reference in New Issue
Block a user