Commit efb86266 authored by 18손재민's avatar 18손재민

이제 강호패를 획득할 경우 호패가 아래에 쌓임

parent 767e7af6
......@@ -53,8 +53,9 @@ socket.on('defeat', function(msg) // object player
socket.on('attackSucceed', function(msg)
{
WordSpace.nameGroup.push(new NameWord(msg.victim, true));
let tempWord = new NameWord(msg.victim, true);
tempWord.instantiate(WordSpace.gameSceneForTest);
tempWord.destroy();
});
// out game
......
......@@ -66,12 +66,15 @@ class WordObject
WordSpace.totalWeight -= this.wordWeight;
WordSpace.totalWordNum -= 1;
WordSpace.resetGameOverTimer();
this.wordObj.destroy();
const groupIdx = WordSpace.wordGroup.findIndex(function(item) {return this.isEqualObject(item.generationCode)}, this);
if (groupIdx > -1) WordSpace.wordGroup.splice(groupIdx, 1);
const forceIdx = WordSpace.wordForcedGroup.findIndex(function(item) {return this.isEqualObject(item.generationCode)}, this);
if (forceIdx > -1) WordSpace.wordForcedGroup.splice(forceIdx, 1);
WordSpace.wordPhysicsGroup.remove(this.physicsObj, true, true);
if(!this.isNameWord)
{
this.wordObj.destroy();
WordSpace.wordPhysicsGroup.remove(this.physicsObj, true, true);
}
}
......@@ -187,15 +190,6 @@ class NameWord extends WordObject
this.physicsObj.setVelocity(0, 0);
this.physicsObj.setPosition(100 + WordSpace.nameGroup.length * 50, 650).setDepth(2);
this.wordObj.setPosition(this.physicsObj.x, this.physicsObj.y).setDepth(2);
console.log(this.generationCode + ': ' + this.wordText + ' destroyed');
WordSpace.totalWeight -= this.wordWeight;
WordSpace.totalWordNum -= 1;
WordSpace.resetGameOverTimer();
const groupIdx = WordSpace.wordGroup.findIndex(function(item) {return this.isEqualObject(item.generationCode)}, this);
if (groupIdx > -1) WordSpace.wordGroup.splice(groupIdx, 1);
const forceIdx = WordSpace.wordForcedGroup.findIndex(function(item) {return this.isEqualObject(item.generationCode)}, this);
if (forceIdx > -1) WordSpace.wordForcedGroup.splice(forceIdx, 1);
//WordSpace.wordPhysicsGroup.remove(this.physicsObj, true, true);
super.destroy();
}
}
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