Commit 1b56caf0 authored by 18신대성's avatar 18신대성 Committed by 18손재민

전체적으로 Depth 수정

parent 745814fd
......@@ -253,7 +253,7 @@ class GameRoom
{
if (this.currentPhase === GameServer.Phase.START)
{
if (this.phaseChanger < 0 && checkTime - this.startTime > 6000)
if (this.phaseChanger < 0 && checkTime - this.startTime > 60000)
{
this.currentPhase = GameServer.Phase.MAIN;
this.rateArrangePoint = 150;
......
......@@ -13,17 +13,17 @@ BackGround.otherCharacters = [];
BackGround.drawCharacter = function(scene)
{
RoomData.myself.playerImage = scene.add.sprite(game.config.width / 2, game.config.height * 41 / 48, 'pyeongminWrite').setScale(0.45).setDepth(2);
RoomData.myself.playerImage = scene.add.sprite(game.config.width / 2, game.config.height * 41 / 48, 'pyeongminWrite').setScale(0.45).setDepth(5);
RoomData.myself.position = new Phaser.Math.Vector2(RoomData.myself.playerImage.x, RoomData.myself.playerImage.y);
BackGround.characterPos = BackGround.characterPos.sort(function(){return 0.5-Math.random()});
RoomData.players.forEach(function(element){
if(element.id != RoomData.myself.id)
{
element.position = BackGround.characterPos.pop();
element.playerImage = scene.add.sprite(element.position.x, element.position.y, 'pyeongminWrite').setScale(0.315).setDepth(1);
element.playerImage = scene.add.sprite(element.position.x, element.position.y, 'pyeongminWrite').setScale(0.315).setDepth(5);
element.playerImage.flipX = element.position.x < game.config.width / 2 ? true : false;
element.nicknameText = scene.add.text(element.position.x, element.position.y - 90, element.nickname)
.setOrigin(0.5,0.5).setColor('#000000').setPadding(0.5,0.5,0.5,0.5).setDepth(1);
.setOrigin(0.5,0.5).setColor('#000000').setPadding(0.5,0.5,0.5,0.5).setDepth(5.1);
6 }
});
}
......@@ -32,7 +32,7 @@ BackGround.gameBackground = null;
BackGround.drawBrain = function(scene)
{
BackGround.gameBackground = scene.add.sprite(game.config.width / 2, game.config.height / 2, 'gameBackground').setDisplaySize(game.config.width, game.config.height).setDepth(1);
BackGround.gameBackground = scene.add.sprite(game.config.width / 2, game.config.height / 2, 'gameBackground').setDisplaySize(game.config.width, game.config.height).setDepth(3.1);
}
BackGround.drawBackground = function(scene)
......@@ -42,10 +42,10 @@ BackGround.drawBackground = function(scene)
BackGround.drawMenu = function(scene)
{
scene.add.sprite(game.config.width / 2, game.config.height / 2, 'menuBackground').setDisplaySize(game.config.width, game.config.height).setDepth(1);
scene.add.sprite(game.config.width / 2, game.config.height / 2, 'menuBackground').setDisplaySize(game.config.width, game.config.height).setDepth(3);
}
BackGround.drawRoom = function(scene)
{
scene.add.sprite(game.config.width / 2, game.config.height / 2, 'roomBackground').setDisplaySize(game.config.width, game.config.height).setDepth(1);
scene.add.sprite(game.config.width / 2, game.config.height / 2, 'roomBackground').setDisplaySize(game.config.width, game.config.height).setDepth(5.2);
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ socket.on('alert', function(msg) // string errorcode
{
//toAlert = '승리!';
ScenesData.gameScene.add.text(game.config.width / 2, game.config.height / 2, '승리!!!!', {fontSize: '30pt'})
.setPadding(5,5,5,5).setOrigin(0.5, 0.5).setDepth(11)
.setPadding(5,5,5,5).setOrigin(0.5, 0.5).setDepth(9.9)
.setColor('#000000').setBackgroundColor('#ffffff');
gameOver();
......@@ -57,8 +57,8 @@ socket.on('syncRoomScene', function(msg)
let randY = Math.random() * 380 + 100;
var playerSet =
{
sprite: ScenesData.roomScene.add.sprite(randX, randY, 'playerStand').setOrigin(0.5, 0.5).setScale(0.2, 0.2),
nickname: ScenesData.roomScene.add.text(randX-10, randY-60, msg[i].nickname).setOrigin(0.5,0.5).setColor('#000000').setPadding(0.5,0.5,0.5,0.5),
sprite: ScenesData.roomScene.add.sprite(randX, randY, 'playerStand').setOrigin(0.5, 0.5).setScale(0.2, 0.2).setDepth(5),
nickname: ScenesData.roomScene.add.text(randX-10, randY-60, msg[i].nickname).setOrigin(0.5,0.5).setColor('#000000').setPadding(0.5,0.5,0.5,0.5).setDepth(5.1),
id: msg[i].id
}
ScenesData.roomScene.players.push(playerSet);
......@@ -79,8 +79,8 @@ socket.on('setRoomCount', function(msg)
let randY = Math.random() * 380 + 100;
var playerSet =
{
sprite: ScenesData.roomScene.add.sprite(randX, randY, 'playerStand').setOrigin(0.5, 0.5).setScale(0.2, 0.2),
nickname: ScenesData.roomScene.add.text(randX-10, randY-60, msg.player.nickname).setOrigin(0.5,0.5).setColor('#000000').setPadding(0.5,0.5,0.5,0.5),
sprite: ScenesData.roomScene.add.sprite(randX, randY, 'playerStand').setOrigin(0.5, 0.5).setScale(0.2, 0.2).setDepth(5),
nickname: ScenesData.roomScene.add.text(randX-10, randY-60, msg.player.nickname).setOrigin(0.5,0.5).setColor('#000000').setPadding(0.5,0.5,0.5,0.5).setDepth(5.1),
id: msg.player.id
}
ScenesData.roomScene.players.push(playerSet);
......@@ -129,7 +129,7 @@ socket.on('changePhase', function(msg) // number Phase
WordSpace.pauseCycle(true);
// 여기서 종이 드르륵 열면됨
let phaseChangeBgr = ScenesData.gameScene.add.sprite(game.config.width / 2, game.config.height / 2, 'phaseChangeBgr').setOrigin(0.5, 0.5).setDepth(10);
let phaseChangeBgr = ScenesData.gameScene.add.sprite(game.config.width / 2, game.config.height / 2, 'phaseChangeBgr').setOrigin(0.5, 0.5).setDepth(9.9);
ScenesData.gameScene.scene.pause('gameScene');
setTimeout(function()
{
......@@ -204,7 +204,7 @@ socket.on('defeat', function(msg) // object player
{
var keys = Object.keys(Enums.item);
WordSpace.generateWord.Item(ScenesData.gameScene, Enums.item[keys[keys.length * Math.random() << 0]]);
let itemBag = ScenesData.gameScene.add.sprite(RoomData.myself.position.x, RoomData.myself.position.y, 'itemBag').setScale(0).setDepth(5);
let itemBag = ScenesData.gameScene.add.sprite(RoomData.myself.position.x, RoomData.myself.position.y, 'itemBag').setScale(0).setDepth(5.3);
ScenesData.gameScene.tweens.add({
targets: itemBag,
scaleX: 1,
......@@ -300,14 +300,14 @@ var backToMenu = function(isWin)
x: game.config.width / 2,
y: game.config.height / 2,
choices: [
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 - 100, game.config.height / 2 - 100, 0, 'playerStand', 0.7, 'center'),
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 - 150, 0,
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 - 100, game.config.height / 2 - 100, 10.2, 'playerStand', 0.7, 'center'),
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 - 150, 10.2,
'button', 1, 'center', '등수 : ' + RoomData.myself.rank + '', 30).layout(),
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 - 50, 0,
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 - 50, 10.2,
'button', 1, 'center', '킬 수 : ' + RoomData.myself.killCount + '', 30).layout(),
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 + 50, 0,
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 + 50, 10.2,
'button', 1, 'center', '획득 강호패 : ' + RoomData.myself.earnedStrongHopae + '', 30).layout(),
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 + 150, 0,
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 + 150, 10.2,
'button', 1, 'center', '획득 골드 : ' + earnedMoney + '', 30).layout()
],
......@@ -316,8 +316,8 @@ var backToMenu = function(isWin)
}
}),
actions: [
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 - 120, game.config.height / 2 + 300, 20, 'button', 1, 'center', '나가기').layout(),
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 + 300, 20, 'button', 1, 'center', '관전하기').layout()
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 - 120, game.config.height / 2 + 300, 10.2, 'button', 1, 'center', '나가기').layout(),
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2 + 120, game.config.height / 2 + 300, 10.2, 'button', 1, 'center', '관전하기').layout()
],
space: {
......@@ -332,7 +332,7 @@ var backToMenu = function(isWin)
align: {
actions: 'center' // 'center'|'left'|'right'
}
}).setDepth(20);
}).setDepth(10.2);
ScenesData.gameScene.backToMenuDialog
.on('button.click', function (button, groupName, index) {
......@@ -340,7 +340,7 @@ var backToMenu = function(isWin)
else
{
ScenesData.gameScene.backToMenuDialog.setVisible(false);
ScenesData.gameScene.backToMenuBtn = UIObject.createButton(ScenesData.gameScene, UIObject.createLabel(ScenesData.gameScene, 100, 900, 5, 'pyeongminThrow', 0.5, 'center'), 1, 0, 2, temp);
ScenesData.gameScene.backToMenuBtn = UIObject.createButton(ScenesData.gameScene, UIObject.createLabel(ScenesData.gameScene, 100, 900, 10.2, 'pyeongminThrow', 0.5, 'center'), 1, 0, 2, temp);
}
}, ScenesData.gameScene)
.on('button.over', function (button, groupName, index) {
......
......@@ -45,8 +45,8 @@ var menuScene = new Phaser.Class(
PlayerData.currentHopae = (PlayerData.userData.recentHopae == null) ? PlayerData.userData.hopae[0] : PlayerData.userData.recentHopae;
PlayerData.nickname = PlayerData.currentHopae.name;
this.userName = this.add.text(100, 100, '내 이름 : ' + PlayerData.userData.userName).setOrigin(0, 0.5).setColor('#000000').setDepth(10).setPadding(5,5,5,5).setFontSize(40);
this.money = this.add.text(100, 200, '소지 엽전 : ' + PlayerData.userData.money).setOrigin(0, 0.5).setColor('#000000').setDepth(10).setPadding(5,5,5,5).setFontSize(40);
this.userName = this.add.text(100, 100, '내 이름 : ' + PlayerData.userData.userName).setOrigin(0, 0.5).setColor('#000000').setDepth(9.9).setPadding(5,5,5,5).setFontSize(40);
this.money = this.add.text(100, 200, '소지 엽전 : ' + PlayerData.userData.money).setOrigin(0, 0.5).setColor('#000000').setDepth(9.9).setPadding(5,5,5,5).setFontSize(40);
this.organizeHopae = function()
{
......@@ -68,7 +68,7 @@ var menuScene = new Phaser.Class(
this.hopaeMenuObject = [];
for(let i = 0; i < this.myHopae.length; i++)
{
let temp = UIObject.createButton(this, UIObject.createLabel(this, 100, 300, 10,
let temp = UIObject.createButton(this, UIObject.createLabel(this, 100, 300, 5,
'nameBgr' + ScenesData.menuScene.myHopae[i].name.length, 1, 'left', ScenesData.menuScene.myHopae[i].name, 25, '#ffffff', 0.45, 0.5), 0, 0, 0,
function()
{
......@@ -101,7 +101,7 @@ var menuScene = new Phaser.Class(
this.createCurrentHopae = function()
{
this.currentHopaeBtn = UIObject.createButton(this, UIObject.createLabel(this, 100, 300, 10,
this.currentHopaeBtn = UIObject.createButton(this, UIObject.createLabel(this, 100, 300, 5,
'nameBgr' + PlayerData.nickname.length, 1, 'left', PlayerData.nickname, 25, '#ffffff', 0.45, 0.5), 0, 0, 0,
function()
{
......@@ -147,7 +147,7 @@ var menuScene = new Phaser.Class(
expand: {
content: false, // Content is a pure text object
}
}).layout().setDepth(10).setVisible(false);
}).layout().setDepth(11).setVisible(false);
this.roomEnterDialog
.on('button.click', function (button, groupName, index) {
......@@ -230,7 +230,7 @@ var hopaeScene = new Phaser.Class(
background: this.add.sprite(game.config.width / 2, game.config.height / 2, 'panel').setOrigin(0.5, 0.5),
content: this.add.text(0, 0, '이 이름으로 하시겠습니까?' + (PlayerData.userData.hopae == undefined ? '\n(최초 호패는 비용이 들지 않습니다.)' : '\n변경에는 엽전이 소모됩니다.'), {
content: this.add.text(0, 0, '이 이름으로 하시겠습니까?' + (PlayerData.userData.hopae.length == 0 ? '\n(최초 호패는 비용이 들지 않습니다.)' : '\n변경에는 엽전이 소모됩니다.'), {
font: '50pt 궁서',
color: '#000000',
align: 'center'
......@@ -258,7 +258,7 @@ var hopaeScene = new Phaser.Class(
expand: {
content: false, // Content is a pure text object
}
}).layout().setDepth(10).setVisible(false);
}).layout().setDepth(11).setVisible(false);
this.checkDialog
.on('button.click', function (button, groupName, index) {
......@@ -295,7 +295,7 @@ var hopaeScene = new Phaser.Class(
.on('button.out', function (button, groupName, index) {
//console.log('button out');
});
this.warningText = UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 100, 2, 'panel', 1, 'center',
this.warningText = UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 100, 5, 'panel', 1, 'center',
'이름 타수가 많아 플레이에 패널티가 있을 수 있습니다', 40, '#000000').setVisible(false).layout();
this.checkBtn = UIObject.createButton(this, UIObject.createLabel(this, game.config.width / 2, 900, 5, 'pyeongminWrite', 0.5, 'center'), 1, 0, 2,
......@@ -347,8 +347,8 @@ var roomScene = new Phaser.Class(
this.isCountEnd = false;
this.endTime = 0;
this.peopleCount = 1;
this.countText = this.add.text(game.config.width / 2, game.config.height / 2, '사람들을 위해 대기중입니다...').setOrigin(0.5, 0.5).setColor('#000000').setBackgroundColor('#ffffff').setDepth(10).setPadding(5,5,5,5);
this.peopleText = this.add.text(game.config.width / 2, game.config.height / 9, '1 / 10').setOrigin(0.5, 0.5).setColor('#000000').setBackgroundColor('#ffffff').setDepth(10);
this.countText = this.add.text(game.config.width / 2, game.config.height / 2, '사람들을 위해 대기중입니다...').setOrigin(0.5, 0.5).setColor('#000000').setBackgroundColor('#ffffff').setDepth(9.9).setPadding(5,5,5,5);
this.peopleText = this.add.text(game.config.width / 2, game.config.height / 9, '1 / 10').setOrigin(0.5, 0.5).setColor('#000000').setBackgroundColor('#ffffff').setDepth(9.9);
},
update: function()
......@@ -431,8 +431,8 @@ var gameScene = new Phaser.Class(
sceneKey: 'button'
});
WordSpace.resetGame();
WordSpace.weightTextObjForTest = this.add.text(game.config.width * 5 / 64, game.config.height * 5 / 48, '뇌의 무게: (현재) 0 / ' + this.brainCapacity + ' (전체)').setDepth(10).setColor('#000000');
WordSpace.killLogTextForTest = this.add.text(game.config.width * 25 / 32, game.config.height * 5 / 72, WordSpace.killLogForTest).setDepth(10).setColor('#000000').setAlign('right');
WordSpace.weightTextObjForTest = this.add.text(game.config.width * 5 / 64, game.config.height * 5 / 48, '뇌의 무게: (현재) 0 / ' + this.brainCapacity + ' (전체)').setDepth(9.9).setColor('#000000');
WordSpace.killLogTextForTest = this.add.text(game.config.width * 25 / 32, game.config.height * 5 / 72, WordSpace.killLogForTest).setDepth(9.9).setColor('#000000').setAlign('right');
},
create: function()
......
......@@ -20,7 +20,7 @@ class WordObject
var random = WordSpace.getSpawnPoint(lenRate);
this.physicsObj = scene.physics.add.sprite(random.x, random.y, spriteName).setMass(this.wordWeight * 10).setScale(this.scale)
.setFrictionX(0).setFrictionY(0).setBounce(0.5);
.setFrictionX(0).setFrictionY(0).setBounce(0.5).setDepth(1);
this.physicsObj.wordCollider = null;
let dist = Phaser.Math.Distance.Between(this.physicsObj.x, this.physicsObj.y, WordSpace.gravityPoint.x, WordSpace.gravityPoint.y);
let angle = Phaser.Math.Angle.Between(this.physicsObj.x, this.physicsObj.y, WordSpace.gravityPoint.x, WordSpace.gravityPoint.y);
......@@ -35,7 +35,7 @@ class WordObject
fontFamily: '"궁서", 궁서체, serif',
//fontStyle: (this.wordWeight > 5 ? 'bold' : '')
});
this.wordObj.setColor(textColor).setOrigin(0.5,0.5);
this.wordObj.setColor(textColor).setOrigin(0.5,0.5).setDepth(1);
this.createdTime = WordSpace.gameTimer.now;
WordSpace.totalWeight += this.wordWeight;
WordSpace.totalWordNum += 1;
......@@ -54,7 +54,7 @@ class WordObject
const forceIdx = WordSpace.wordForcedGroup.findIndex(function(item) {return this.isEqualObject(item.generationCode)}, this);
if (forceIdx > -1) WordSpace.wordForcedGroup.splice(forceIdx, 1);
WordSpace.wordPhysicsGroup.remove(this.physicsObj);
let breakAnim = ScenesData.gameScene.add.sprite(this.physicsObj.x, this.physicsObj.y, 'wordBreak').setScale(0.5).setDepth(3).play('wordBreakAnim');
let breakAnim = ScenesData.gameScene.add.sprite(this.physicsObj.x, this.physicsObj.y, 'wordBreak').setScale(0.5).setDepth(1.1).play('wordBreakAnim');
setTimeout(function() {
breakAnim.destroy();
}, 200);
......@@ -285,8 +285,8 @@ class NameWord extends WordObject
if(!this.isStrong) WordSpace.attackGauge.add(this.wordTyping * 0.1);
WordSpace.nameGroup.push(this);
this.isActive = false;
this.physicsObj.setVelocity(0, 0).setDepth(20);
this.wordObj.setPosition(this.physicsObj.x, this.physicsObj.y).setDepth(20);
this.physicsObj.setVelocity(0, 0).setDepth(10.2);
this.wordObj.setPosition(this.physicsObj.x, this.physicsObj.y).setDepth(10.2);
this.follower = { t: 0, vec: new Phaser.Math.Vector2() };
this.path = new Phaser.Curves.Spline([
this.physicsObj.x, this.physicsObj.y,
......
......@@ -112,7 +112,7 @@ WordSpace.attackGauge =
generate: function(scene)
{
//console.log("created");
this.rectUI = scene.add.rectangle(game.config.width / 2, game.config.height * 5 / 6, 0, game.config.height * 11 / 720).setDepth(11);
this.rectUI = scene.add.rectangle(game.config.width / 2, game.config.height * 5 / 6, 0, game.config.height * 11 / 720).setDepth(10.1);
},
add: function(plus)
{
......@@ -143,7 +143,7 @@ WordSpace.attackGauge =
};
this.currentCycle = scene.time.addEvent(option);
this.text = scene.add.text(100,100,'게이지: ' + this.value.toFixed(1)).setDepth(10).setColor('#000000');
this.text = scene.add.text(100,100,'게이지: ' + this.value.toFixed(1)).setDepth(9.9).setColor('#000000');
//this.rectUI.setColor(this.gradeColor[0]);
},
pauseCycle: function(bool) {this.currentCycle.paused = bool;},
......@@ -343,7 +343,7 @@ WordSpace.setPlayerTyping =
},
initiate: function(scene)
{
this.text = scene.add.text(100,200,'현재 타수 : ' + WordSpace.playerTyping.toFixed(1)).setDepth(10).setColor('#000000');
this.text = scene.add.text(100,200,'현재 타수 : ' + WordSpace.playerTyping.toFixed(1)).setDepth(9.9).setColor('#000000');
},
reset: function()
{
......@@ -417,7 +417,7 @@ WordSpace.attack = function(wordText, grade)
WordSpace.makeAttackPaper = function(scene, attackFrom, attackTo, multiple)
{
var attackPaper = scene.add.sprite(attackFrom.x, attackFrom.y, 'attackPaper').setScale(0.5 * multiple).setDepth(3);
var attackPaper = scene.add.sprite(attackFrom.x, attackFrom.y, 'attackPaper').setScale(0.5 * multiple).setDepth(5.2);
attackPaper.mask = new Phaser.Display.Masks.BitmapMask(scene, BackGround.gameBackground);
attackPaper.throwTarget = attackTo;
attackPaper.follower = { t: 0, vec: new Phaser.Math.Vector2() };
......
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