Commit 94301cf4 authored by 18신대성's avatar 18신대성

시즌 11호 머지

parent 25692f08
......@@ -93,6 +93,7 @@ GameServer.enterRoom = function(roomIdx, playerData)
{
room.endTime = Date.now() + 15000; // 테스트로 15초로 남겨둠
this.announceToRoom(room.roomNum, 'setCount', {isEnable: true, endTime: room.endTime});
room.currentPhase = this.Phase.COUNT;
}
else if (room.currentPhase === this.Phase.COUNT) // countinue count
{
......@@ -102,6 +103,7 @@ GameServer.enterRoom = function(roomIdx, playerData)
else // stop count
{
this.announceToRoom(room.roomNum, 'setCount', {isEnable: false, endTime: 0});
room.currentPhase = this.Phase.READY;
}
return room;
}
......
......@@ -48,14 +48,17 @@ var roomScene = new Phaser.Class(
{
this.isCounting = false;
this.endTime = 0;
this.peopleCount = 1;
this.countText = this.add.text(640, 360, '사람들을 위해 대기중입니다...').setOrigin(0.5, 0.5).setColor('#000000');
this.peopleText = this.add.text(640, 100, '1 / 10').setOrigin(0.5, 0.5).setColor('#000000');
},
update: function()
{
this.peopleText.setText(peopleCount + ' / 10');
if (this.isCounting)
{
this.countText.setText((this.endTime - Date.now()) / 1000);
this.countText.setText(((this.endTime - Date.now()) / 1000).toFixed(1));
if (this.endTime - Date.now() < 0)
{
socket.emit('endCount');
......
......@@ -144,6 +144,7 @@ io.on('connection', function(socket)
if (data.currentRoom.aliveCount < GameServer.startCount)
{
GameServer.announceToRoom(GameServer.findRoomIndex(data.currentRoom.roomNum), 'setCount', {isEnable: false, endTime: 0});
room.currentPhase = this.Phase.READY;
}
}
else if (data.playingData.isAlive)
......
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