Commit 5efa8948 authored by 18손재민's avatar 18손재민

이제 공격자와 피격자는 종이 뭉치가 날아가는 것을 동시에 볼 수 있음

parent 0541c50e
......@@ -76,7 +76,7 @@ class GameRoom
{
this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1;
this.startCount = 4;
this.startCount = 2;
this.maxPlayer = 100;
this.nextRank = 100;
......
......@@ -163,7 +163,9 @@ socket.on('attacked', function(msg) // object attackData
WordSpace.attackedEvents.push(attackedEvent);
console.log(msg.attacker);
console.log(msg.victim);
WordSpace.makeAttackPaper(ScenesData.gameScene, msg.victim.position, msg.attacker.position);
let victimPos = RoomData.players.find(function(element){ return element.id == msg.victim.id; });
let attackerPos = RoomData.players.find(function(element){ return element.id == msg.attacker.id; });
WordSpace.makeAttackPaper(ScenesData.gameScene, attackerPos.position, victimPos.position);
//console.log(timeout);
});
socket.on('defeat', function(msg) // object player
......
......@@ -445,7 +445,6 @@ WordSpace.makeAttackPaper = function(scene, attackFrom, attackTo)
{
var attackPaper = scene.add.sprite(attackFrom.x, attackFrom.y, 'attackPapaer').setScale(0.5).setDepth(3);
attackPaper.throwTarget = attackTo;
console.log(attackTo);
attackPaper.follower = { t: 0, vec: new Phaser.Math.Vector2() };
attackPaper.path = new Phaser.Curves.Spline([
attackFrom.x, attackFrom.y,
......
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