Commit 93dde5b8 authored by 18손재민's avatar 18손재민

호패 클래스 및 플레이어 닉네임 만듬

parent c57b65f3
......@@ -67,11 +67,25 @@ class WordObject
class AttackWord extends WordObject
{
constructor(text, _attacker)
constructor(text, isStrong)
{
super(text);
this.attacker = _attacker;
if(WordReader.getWordTyping(playerName) <= 9)
this.wordWeight += this.wordWeight * 0.2 * (WordReader.getWordTyping(playerName) - 9);
this.wordWeight *= isStrong ? 3 : 2;
this.attacker = playerNum;
this.attackedTime = WordSpace.gameTimer.now;
console.log('Attack text : ' + text + ', Attacker : ' + _attacker);
}
}
\ No newline at end of file
}
class NameWord extends WordObject
{
constructor(text, _isStrong = false)
{
super(text);
this.wordWeight = 2;
this.isStrong = _isStrong;
console.log('Attack text : ' + text + ', Attacker : ' + _attacker);
}
}
......@@ -13,7 +13,12 @@ var config = {
};
var game = new Phaser.Game(config)
var playerNum = -1;
//플레이어 정보, 서버 통신시 필요할 듯
//테스트용이므로 차후 수정 요망
var playerNum = -1; //플레이어 아이디, 고유 번호
var playerName = '임시아이디' //플레이어 닉네임
// client side
var socket = io.connect();
......
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