Commit 40bdb4af authored by 18신대성's avatar 18신대성 Committed by 18류지석

시즌 6호 머지

parent 0fe2f3f6
...@@ -9,7 +9,7 @@ WordSpace.isImageLoaded = false; ...@@ -9,7 +9,7 @@ WordSpace.isImageLoaded = false;
WordSpace.nextWordCode = 0; WordSpace.nextWordCode = 0;
WordSpace.totalWeight = 0; //현재 단어 무게 총합 WordSpace.totalWeight = 0; //현재 단어 무게 총합
WordSpace.totalWordNum = 0; WordSpace.totalWordNum = 0;
WordSpace.brainCapacity = 50; //수용 가능한 단어 무게 최대치 WordSpace.brainCapacity = 200; //수용 가능한 단어 무게 최대치
WordSpace.defeatTime = 5000; WordSpace.defeatTime = 5000;
WordSpace.gameTimer = null; //현재 게임 플레이 시간 타이머 WordSpace.gameTimer = null; //현재 게임 플레이 시간 타이머
WordSpace.isTimerOn = false; WordSpace.isTimerOn = false;
...@@ -30,7 +30,7 @@ WordSpace.NameSpawnReduce = 1000; ...@@ -30,7 +30,7 @@ WordSpace.NameSpawnReduce = 1000;
WordSpace.gravityPoint = {x: 640, y: 300}; WordSpace.gravityPoint = {x: 640, y: 300};
class cycle //앞으로 cycle은 이 클래스를 사용해서 구현할 것 class Cycle //앞으로 cycle은 이 클래스를 사용해서 구현할 것
{ {
constructor(_callback) constructor(_callback)
{ {
...@@ -55,19 +55,19 @@ class cycle //앞으로 cycle은 이 클래스를 사용해서 구현할 것 ...@@ -55,19 +55,19 @@ class cycle //앞으로 cycle은 이 클래스를 사용해서 구현할 것
} }
//단어 생성 사이클 //단어 생성 사이클
WordSpace.wordCycle = new cycle(function() WordSpace.wordCycle = new Cycle(function()
{ {
WordSpace.genWordByProb(this); WordSpace.genWordByProb(this);
}); });
//게임 오버 사이클 //게임 오버 사이클
WordSpace.gameOverCycle = new cycle(gameOver); WordSpace.gameOverCycle = new Cycle(gameOver);
//호패 생성 사이클 //호패 생성 사이클
WordSpace.nameCycle = new cycle(function() WordSpace.nameCycle = new Cycle(function()
{ {
WordSpace.generateWord.Name(WordSpace.gameSceneForTest, false); WordSpace.generateWord.Name(WordSpace.gameSceneForTest, false);
}); });
//이건 뭐지 //이건 뭐지
WordSpace.varAdjustCycle = new cycle(function() WordSpace.varAdjustCycle = new Cycle(function()
{ {
//나중에는 메세지 분석해서 Phase랑 PlayerTypingRate 받겠지만 일단 이렇게 해둠 //나중에는 메세지 분석해서 Phase랑 PlayerTypingRate 받겠지만 일단 이렇게 해둠
//WordSpace.GetPhase(); //WordSpace.GetPhase();
...@@ -142,13 +142,6 @@ WordSpace.AdjustVarByPhase = function(typingRate, phase) ...@@ -142,13 +142,6 @@ WordSpace.AdjustVarByPhase = function(typingRate, phase)
WordSpace.nameCycle.resetCycle(WordSpace.gameSceneForTest, WordSpace.NameSpawnDelay, WordSpace.nameCycle.currentCycle.getElapsed(), true); WordSpace.nameCycle.resetCycle(WordSpace.gameSceneForTest, WordSpace.NameSpawnDelay, WordSpace.nameCycle.currentCycle.getElapsed(), true);
} }
WordSpace.GetPlayerTypingRate = function()
{
//서버통신하셈~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//임시
WordSpace.PlayerTypingRate = 0.5;
}
WordSpace.attackGauge = WordSpace.attackGauge =
{ {
value: 0, value: 0,
......
...@@ -18,106 +18,3 @@ var game = new Phaser.Game(config) ...@@ -18,106 +18,3 @@ var game = new Phaser.Game(config)
//테스트용이므로 차후 수정 요망 //테스트용이므로 차후 수정 요망
var playerNum = -1; //플레이어 아이디, 고유 번호 var playerNum = -1; //플레이어 아이디, 고유 번호
var playerName = '임시아이디' //플레이어 닉네임 var playerName = '임시아이디' //플레이어 닉네임
//test
/*window.addEventListener("message", function(event)
{
window.addEventListener("message", function (event) {
var sub = 0;
if (event.data == "tick") {
if (window.lafcb)
if ((new Date().getTime() / 1000) - window.lafcb.started > 0.5) {
window.lafcb.func(new Date().getTime() + 16)
window.lafcb = null;
}
var i = window.timeouts.length;
while (i--) {
if (window.timeouts[i].ran) {
window.timeouts.splice(i, 1);
}
}
var i = window.timeouts.length;
while (i--) {
if (new Date().getTime() - window.timeouts[i].started >= window.timeouts[i].delay && window.timeouts[i]) {
window.timeouts[i].func();
window.timeouts[i].ran = true;
}
}
for (var i in window.intervals) {
var currTime = new Date().getTime();
if (currTime - window.intervals[i].last >= window.intervals[i].delay && window.intervals[i]) {
window.intervals[i].last = currTime;
window.intervals[i].func();
}
}
window.postMessage('tick', '*');
}
}, false);
(function (context) {
'use strict';
window.lafcb = null;
context.timeouts = [];
context.intervals = [];
var lastTime = new Date().getTime();
context.old = {};
old.setTimeout = (i, ii) => context.setTimeout(i, ii);
old.setInterval = (i, ii) => context.setInterval(i, ii);
old.clearTimeout = (i) => context.clearTimeout(i);
old.clearInterval = (i) => context.clearInterval(i);
if (typeof (context.postMessage) == 'function') {
context.setTimeout = function (fn, millis) {
var id = timeouts.length
timeouts[id] = { id: id, func: fn, delay: millis, started: new Date().getTime() };
return id;
};
context.clearTimeout = function (cancel) {
for (var i in timeouts) {
if (timeouts[i].id == cancel) {
timeouts.splice(i, 1);
break;
}
}
};
context.setInterval = function (fn, delay) {
intervals[intervals.length] = { func: fn, delay: delay, last: new Date().getTime() };
return intervals[intervals.length - 1];
};
context.clearInterval = function (cancel) {
for (var i in intervals) {
if (intervals[i] == cancel) {
intervals.splice(i, 1);
break;
}
}
};
}
context.requestAnimationFrame = function (callback, element) {
lafcb = { started: new Date().getTime() / 1000, func: callback };
var currTime = new Date().getTime();
var timeToCall = 16;
var id = context.setTimeout(function () {
callback(currTime + timeToCall);
}, timeToCall);
return id;
};
context.cancelAnimationFrame = function (id) {
lafcb
context.clearTimeout(id);
};
context.addEventListener("load", function () {
if (typeof (context.postMessage) == 'function') {
context.postMessage('tick', '*');
} else {
context.setTimeout = old.setTimeout
context.setInterval = old.setInterval
context.clearTimeout = old.clearTimeout
context.clearInterval = old.clearInterval
alert("Your browser does not support postMessage. Sorry but you will be forced to default to the standard setInterval and setTimeout functions. This means you may experience pauses in your game when you navigate away from the tab it is playing in.");
}
});
})(this);
*/
...@@ -50,7 +50,7 @@ io.on('connection', function(socket) ...@@ -50,7 +50,7 @@ io.on('connection', function(socket)
{ {
socket.playerData.playerTyping = msg; socket.playerData.playerTyping = msg;
//console.log(socket.playerData.currentRoom); //console.log(socket.playerData.currentRoom);
console.log(socket.playerData.currentRoom.currentPlayer.length); //console.log(socket.playerData.currentRoom.currentPlayer.length);
//let playerTypingRate = (msg - (socket.playerData.currentRoom.minTypingPlayer.playerTyping - socket.playerData.currentRoom.rateArrangePoint)) / //let playerTypingRate = (msg - (socket.playerData.currentRoom.minTypingPlayer.playerTyping - socket.playerData.currentRoom.rateArrangePoint)) /
//(socket.playerData.currentRoom.maxTypingPlayer.playerTyping - socket.playerData.currentRoom.minTypingPlayer.playerTyping + socket.playerData.currentRoom.rateArrangePoint * 2); //(socket.playerData.currentRoom.maxTypingPlayer.playerTyping - socket.playerData.currentRoom.minTypingPlayer.playerTyping + socket.playerData.currentRoom.rateArrangePoint * 2);
//socket.emit('setPlayerTypingRate', playerTypingRate); //socket.emit('setPlayerTypingRate', playerTypingRate);
......
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