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

시즌 20호 머지

parents 0be9638b 9126adbc
...@@ -82,7 +82,7 @@ class GameRoom ...@@ -82,7 +82,7 @@ class GameRoom
{ {
this.roomId = GameServer.getRoomNumber(); this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1; this.roomIndex = -1;
this.startCount = 5; this.startCount = 2;
this.maxPlayer = 100; this.maxPlayer = 100;
this.nextRank = 100; this.nextRank = 100;
...@@ -143,7 +143,8 @@ class GameRoom ...@@ -143,7 +143,8 @@ class GameRoom
{ {
if (this.currentPhase === GameServer.Phase.READY) if (this.currentPhase === GameServer.Phase.READY)
{ {
this.endTime = Date.now() + 30000; // 방 대기 시간 this.countStartTime = Date.now();
this.endTime = 10000; // 방 대기 시간
this.announceToRoom('setRoomCount', this.announceToRoom('setRoomCount',
{ {
isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length, isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length,
...@@ -153,6 +154,7 @@ class GameRoom ...@@ -153,6 +154,7 @@ class GameRoom
} }
else if (this.currentPhase === GameServer.Phase.COUNT) else if (this.currentPhase === GameServer.Phase.COUNT)
{ {
this.endTime = this.endTime - (Time.now() - this.countStartTime);
this.announceToRoom('setRoomCount', this.announceToRoom('setRoomCount',
{ {
isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length, isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length,
...@@ -264,13 +266,17 @@ class GameRoom ...@@ -264,13 +266,17 @@ class GameRoom
console.table(this.currentPlayer); console.table(this.currentPlayer);
this.announceToRoom('startGame'); this.announceToRoom('startGame');
this.startTime = Date.now(); this.startTime = Date.now();
setTimeout(function()
{
this.checkPhase(Date.now());
}.bind(this), 6000);
} }
checkPhase(checkTime) checkPhase(checkTime)
{ {
if (this.currentPhase === GameServer.Phase.START) if (this.currentPhase === GameServer.Phase.START)
{ {
if (this.phaseChanger < 0 && checkTime - this.startTime > 1000) if (checkTime - this.startTime > 6000)
{ {
this.currentPhase = GameServer.Phase.MAIN; this.currentPhase = GameServer.Phase.MAIN;
this.rateArrangePoint = 150; this.rateArrangePoint = 150;
...@@ -289,7 +295,7 @@ class GameRoom ...@@ -289,7 +295,7 @@ class GameRoom
} }
else if (this.currentPhase === GameServer.Phase.MAIN) else if (this.currentPhase === GameServer.Phase.MAIN)
{ {
let playerLimit = Math.min(Math.round(this.currentPlayer.length / 5), 3); let playerLimit = Math.max(Math.round(this.currentPlayer.length / 5), 3);
if (this.aliveCount <= playerLimit) if (this.aliveCount <= playerLimit)
{ {
this.currentPhase = GameServer.Phase.MUSIC; this.currentPhase = GameServer.Phase.MUSIC;
......
...@@ -70,7 +70,7 @@ socket.on('setRoomCount', function(msg) ...@@ -70,7 +70,7 @@ socket.on('setRoomCount', function(msg)
setTimeout(function() setTimeout(function()
{ {
ScenesData.roomScene.isCounting = msg.isEnable; ScenesData.roomScene.isCounting = msg.isEnable;
ScenesData.roomScene.endTime = msg.endTime; ScenesData.roomScene.endTime = Date.now() + msg.endTime;
ScenesData.roomScene.peopleCount = msg.playerCount; ScenesData.roomScene.peopleCount = msg.playerCount;
if (msg.isEnter) // generate character if (msg.isEnter) // generate character
......
...@@ -67,7 +67,7 @@ var menuScene = new Phaser.Class( ...@@ -67,7 +67,7 @@ var menuScene = new Phaser.Class(
PlayerData.currentHopae = (PlayerData.userData.recentHopae == null) ? PlayerData.userData.hopae[0] : PlayerData.userData.recentHopae; PlayerData.currentHopae = (PlayerData.userData.recentHopae == null) ? PlayerData.userData.hopae[0] : PlayerData.userData.recentHopae;
PlayerData.nickname = PlayerData.currentHopae.name; PlayerData.nickname = PlayerData.currentHopae.name;
this.userName = this.add.text(250, 75, PlayerData.userData.userName).setOrigin(0, 0.5).setColor('#000000').setDepth(9.9).setPadding(5,5,5,5).setFont('40pt sejongFont'); this.userName = this.add.text(250, 75, PlayerData.userData.userName.length < 10 ? PlayerData.userData.userName : PlayerData.userData.userName.substr(0, 8) + '...').setOrigin(0, 0.5).setColor('#000000').setDepth(9.9).setPadding(5,5,5,5).setFont('40pt sejongFont');
this.money = this.add.text(950, 70, PlayerData.userData.money + '').setOrigin(1, 0.5).setColor('#ffffff').setDepth(9.9).setPadding(5,5,5,5).setFont('40pt sejongFont'); this.money = this.add.text(950, 70, PlayerData.userData.money + '').setOrigin(1, 0.5).setColor('#ffffff').setDepth(9.9).setPadding(5,5,5,5).setFont('40pt sejongFont');
this.organizeHopae = function() this.organizeHopae = function()
......
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