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

단어 생성 범위 넓힘, 이제 막타를 친 플레이어에게 아이템 단어가 생성됨

parent c6744745
......@@ -76,7 +76,7 @@ class GameRoom
{
this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1;
this.startCount = 2;
this.startCount = 3;
this.maxPlayer = 100;
this.nextRank = 100;
......
......@@ -174,6 +174,11 @@ socket.on('defeat', function(msg) // object player
{
console.log(RoomData.players[msg.index].nickname + ' defeated by ' + msg.lastAttack.attacker + ', with ' + msg.lastAttack.word);
WordSpace.killLogForTest += ('\n' + msg.lastAttack.attacker + ' --' + msg.lastAttack.word + '-> ' + RoomData.players[msg.index].nickname);
if(msg.lastAttack.attackerId == RoomData.myself.id)
{
var keys = Object.keys(Enums.item);
WordSpace.generateWord.Item(ScenesData.gameScene, Enums.item[keys[keys.length * Math.random() << 0]]);
}
}
else
{
......
......@@ -118,9 +118,9 @@ class NormalWord extends WordObject
case 3: WordSpace.attackGauge.add(0.5); break;
default: console.log('[ERR] wrong grade of word'); break;
}
this.wordObj.destroy();
this.physicsObj.destroy();
}
this.wordObj.destroy();
this.physicsObj.destroy();
}
}
......@@ -161,7 +161,11 @@ class AttackWord extends WordObject
if(this.isDark)
{
setTimeout(() => {
if(this.maskBackground != null && this.mask != null) this.maskBackground.setMask(this.mask);
if(this.maskBackground != null && this.mask != null)
{
this.maskBackground.setMask(this.mask);
this.maskBackground.alpha = 0.5;
}
}, 4000);
}
else this.maskBackground.setMask(this.mask);
......
......@@ -44,8 +44,8 @@ WordSpace.getSpawnPoint = function(_lenRate)
{
let lenRate = 1;
if(typeof _lenRate == 'number') lenRate = _lenRate;
let xLen = 550 * lenRate;
let yLen = 350 * lenRate;
let xLen = 650 * lenRate;
let yLen = 500 * lenRate;
const angle = Math.random() * Math.PI * 2;
let _x = xLen * Math.cos(angle) + this.gravityPoint.x;
let _y = yLen * Math.sin(angle) + this.gravityPoint.y;
......@@ -250,7 +250,8 @@ WordSpace.generateWord =
if(newPlayerData == null)
{
if(WordSpace.nameQueue.queue.length == 1) return null;
word = new NameWord(WordSpace.nameQueue.pop(), isStrong);
let temp = WordSpace.nameQueue.pop();
word = new NameWord(temp, isStrong);
}
else word = new NameWord(newPlayerData, isStrong);
WordSpace.pushWord(scene, word, lenRate);
......@@ -511,11 +512,8 @@ WordSpace.nameQueue =
{
let tempElement = WordSpace.nameQueue.queue.shift();
if(WordSpace.nameQueue.queue.length <= RoomData.aliveCount) this.shuffle();
if(this.queue.length > 0)
{
if(!RoomData.players[tempElement].isAlive && WordSpace.nameQueue.getCount(tempElement) < 3) WordSpace.nameQueue.pop();
else return RoomData.players[tempElement];
}
if(!RoomData.players[tempElement].isAlive && WordSpace.nameQueue.getCount(tempElement) < 3) return WordSpace.nameQueue.pop();
else return RoomData.players[tempElement];
},
getCount: function(player)
{
......
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