Commit 2efabbbe authored by 16이지혜's avatar 16이지혜

Merge branch 'word' of https://git.kucatdog.net/tear-of-sejong/sejong25 into word

parents bb65863c 81c6b389
......@@ -7,14 +7,7 @@ class WordObject
//this.wordText = Input.removeConVow(text);
this.wordTyping = WordReader.getWordTyping(this.wordText);
this.wordGrade = WordReader.getWordGrade(this.wordTyping);
this.wordWeight = (function(_wordGrade)
{
var temp = 0;
temp = _wordGrade == 3 ? 3 :
_wordGrade == 2 ? 5 :
_wordGrade == 1 ? 7 : 10;
return temp;
})(this.wordGrade);
this.wordWeight = WordReader.getWordWeight(this.wordGrade);
//console.log("wordTyping : " + this.wordTyping + '\n' + "wordGrade : " + this.wordGrade + '\n' + "wordWeight : " + this.wordWeight + '\n');
this.wordSpeed = 1;
}
......@@ -22,9 +15,13 @@ class WordObject
instantiate(scene)
{
var random = WordSpace.getSpawnPoint();
this.physicsObj = scene.physics.add.sprite(random.x, random.y, 'wordBgr' + this.wordGrade + '_' + Math.min(Math.max(2, this.wordText.length), 6));
this.physicsObj.body.bounce.set(0.5);
this.wordObj = scene.add.text(random.x, random.y, this.wordText, {fontSize: '18pt', fontFamily: '"궁서", 궁서체, serif'}).setColor('#000000').setOrigin(0.5,0.5);
this.physicsObj = scene.physics.add.sprite(random.x, random.y, 'wordBgr' + this.wordGrade + '_' + Math.min(Math.max(2, this.wordText.length), 6)).setMass(this.wordWeight);
this.wordObj = scene.add.text(random.x, random.y, this.wordText,
{
fontSize: (this.wordWeight + 10) +'pt',
fontFamily: '"궁서", 궁서체, serif',
fontStyle: (this.wordWeight > 5 ? 'bold' : '')
}).setColor('#000000').setOrigin(0.5,0.5);
WordSpace.totalWeight += this.wordWeight;
WordSpace.setGameOverTimer();
console.log("Total weight : " + WordSpace.totalWeight);
......@@ -50,7 +47,5 @@ class WordObject
this.wordObj.setPosition(this.physicsObj.x, this.physicsObj.y);
}
getWordWeight() { return this.wordWeight; }
isEqualObject(_generationCode) { return _generationCode === this.generationCode; }
}
\ No newline at end of file
......@@ -50,4 +50,11 @@ WordReader.getWordGrade = function(_wordTyping)
return 2 <= _wordTyping && _wordTyping < 7 ? 3 :
7 <= _wordTyping && _wordTyping < 12 ? 2 :
12 <= _wordTyping && _wordTyping < 17 ? 1 : 0;
}
WordReader.getWordWeight = function(_wordGrade)
{
return _wordGrade == 3 ? 3 :
_wordGrade == 2 ? 5 :
_wordGrade == 1 ? 7 : 10;
}
\ No newline at end of file
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