Commit 2a3a5c27 authored by 18손재민's avatar 18손재민

단어 등급 및 단어 무게 추가

parent 2fdfec15
...@@ -12,7 +12,18 @@ class WordObject ...@@ -12,7 +12,18 @@ class WordObject
} }
return temp; return temp;
})(this.wordText); })(this.wordText);
//alert(this.wordTyping); this.wordGrade = 2 < this.wordTyping && this.wordTyping < 6 ? 3 :
7 < this.wordTyping && this.wordTyping < 11 ? 2 :
12 < this.wordTyping && this.wordTyping < 16 ? 1 : 0;
this.wordWeight = (function(_wordGrade)
{
var temp = 0;
temp = _wordGrade == 3 ? 3 :
_wordGrade == 2 ? 5 :
_wordGrade == 1 ? 7 : 10;
return temp;
})(this.wordGrade);
//alert("wordTyping : " + this.wordTyping + '\n' + "wordGrade : " + this.wordGrade + '\n' + "wordWeight : " + this.wordWeight + '\n');
} }
generate(scene) generate(scene)
...@@ -30,7 +41,22 @@ class WordObject ...@@ -30,7 +41,22 @@ class WordObject
this.physicsObj.setVelocity(dist * Math.cos(angle) * wordSpeed, dist * Math.sin(angle) * wordSpeed); this.physicsObj.setVelocity(dist * Math.cos(angle) * wordSpeed, dist * Math.sin(angle) * wordSpeed);
this.wordObj.setPosition(this.physicsObj.x, this.physicsObj.y); this.wordObj.setPosition(this.physicsObj.x, this.physicsObj.y);
} }
getWordWeight()
{
return this.wordWeight;
}
}
//***********ToDo*************
WordObject.isEqual(inputWord)
{
if(inputWord === this.wordText)
{
this.destroy();
}
} }
//****************************
function firstSound(charText) function firstSound(charText)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment