Commit 6243e03f authored by 18손재민's avatar 18손재민

Merge branch 'gameScene'

parents 6deb90a8 41333481
......@@ -358,6 +358,7 @@ class Player
this.index = gameRoom.currentPlayer.length;
this.nickname = playerData.nickname;
this.playerImage = null;
this.mat = null;
this.position = null;
this.killCount = 0;
this.earnedStrongHopae = 0;
......
......@@ -14,7 +14,9 @@ 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(5);
RoomData.myself.position = new Phaser.Math.Vector2(RoomData.myself.playerImage.x, RoomData.myself.playerImage.y);
RoomData.myself.position = new Phaser.Math.Vector2(RoomData.myself.playerImage.x - 20, RoomData.myself.playerImage.y - 20);
RoomData.myself.mat = scene.add.sprite(RoomData.myself.position.x, RoomData.myself.position.y, 'mat')
.setScale(0.45).setDepth(4);
BackGround.characterPos = BackGround.characterPos.sort(function(){return 0.5-Math.random()});
RoomData.players.forEach(function(element){
if(element.id != RoomData.myself.id)
......@@ -22,6 +24,9 @@ BackGround.drawCharacter = function(scene)
element.position = BackGround.characterPos.pop();
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.mat = scene.add.sprite(element.position.x - 14 * (element.position.x < game.config.width / 2 ? -1 : 1), element.position.y - 14, 'mat')
.setScale(0.315).setDepth(4);
element.mat.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(5.1);
6 }
......
......@@ -272,7 +272,7 @@ socket.on('defeat', function(msg) // object player
duration: 500,
repeat: 0, // -1: infinity
yoyo: false });
}, 1000);
}, 5000);
},
})
......
......@@ -45,6 +45,7 @@ ResourceLoader.loadImage = function(scene)
scene.load.spritesheet('gameSceneInput', 'assets/image/etc/wordSpace/wordspace.png', { frameWidth: 253, frameHeight: 67 });
scene.load.image('attackPaper', 'assets/image/etc/paper_crumbled.png');
scene.load.image('itemBag', 'assets/image/etc/itembag2.png');
scene.load.image('mat', 'assets/image/etc/mat.png');
scene.load.image('button', 'assets/placeholder/button.png');
scene.load.image('panel', 'assets/placeholder/panel.png');
......
......@@ -68,7 +68,7 @@ var menuScene = new Phaser.Class(
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.money = this.add.text(950, 70, PlayerData.userData.money).setOrigin(1, 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.organizeHopae = function()
{
......@@ -246,12 +246,14 @@ var hopaeScene = new Phaser.Class(
create: function()
{
BackGround.drawBackground(this);
BackGround.drawMenu(this);
if(!(PlayerData.userData.hopae === undefined || PlayerData.userData.hopae.length == 0))
{
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.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.inputBackground = UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 10, 'hopaeSceneInput', 2, 'center', '', 50, '#ffffff', 0.45, 0.5);
Input.inputField.generate(this, function(){}, this.inputBackground);
UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 200, 2, 'dialog2', 1, 'center',
'호패는 오직 한글만 입력이 가능합니다.\n띄어쓰기도 사용할 수 없습니다.', 50, '#000000').layout();
......
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