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

새로 계정을 생성할 경우 바로 호패 생성 씬으로 넘어가게 만듬

parent 9c3f21f8
......@@ -80,7 +80,7 @@ class GameRoom
{
this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1;
this.startCount = 5;
this.startCount = 2;
this.maxPlayer = 100;
this.nextRank = 100;
......
......@@ -246,10 +246,7 @@ class UserData
this.userName = prompt("유저의 이름을 입력해주세요.");
this.exp = 0;
this.rank = -1;
this.hopae =
[
{name: prompt("첫번째 호패의 닉네임을 입력해주세요.\n(반드시 한글만 사용해주세요 띄어쓰기도 금지)"), type: 'wood'}
];
this.hopae = [];
this.recentHopae = null;
this.title = [];
this.money = 0;
......
......@@ -36,6 +36,13 @@ var menuScene = new Phaser.Class(
{
BackGround.drawBackground(this);
Audio.loopSound(this, 'login');
console.log(PlayerData.userData.hopae);
if(PlayerData.userData.hopae === undefined || PlayerData.userData.hopae.length == 0)
{
ScenesData.changeScene('hopaeScene');
PlayerData.userData.money += 1;
return;
}
PlayerData.currentHopae = (PlayerData.userData.recentHopae == null) ? PlayerData.userData.hopae[0] : PlayerData.userData.recentHopae;
PlayerData.nickname = PlayerData.currentHopae.name;
......@@ -215,15 +222,19 @@ var hopaeScene = new Phaser.Class(
Input.inputField.generate(this, function(){},
UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 10, 'nameBgr6', 2, 'center', '', 50, '#ffffff').getElement('text').setOrigin(0.45,0.5), true);
UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 200, 2, 'panel', 1, 'center',
'호패는 오직 한글만 입력이 가능합니다.\n띄어쓰기도 사용할 수 없습니다.', 50, '#000000').layout();
this.checkDialog = this.rexUI.add.dialog({
x: game.config.width / 2,
y: game.config.height / 2,
background: this.add.sprite(game.config.width / 2, game.config.height / 2, 'panel').setOrigin(0.5, 0.5),
content: this.add.text(0, 0, '이 이름으로 하시겠습니까?\n변경에는 엽전이 소모됩니다.', {
content: this.add.text(0, 0, '이 이름으로 하시겠습니까?' + (PlayerData.userData.hopae == undefined ? '\n(최초 호패는 비용이 들지 않습니다.)' : '\n변경에는 엽전이 소모됩니다.'), {
font: '50pt 궁서',
color: '#000000'
color: '#000000',
align: 'center'
}),
actions: [
......
......@@ -10,7 +10,8 @@ UIObject.createLabel = function (scene, x, y, depth, image, size, align, text =
background: scene.add.sprite(x, y, image).setScale(size).setOrigin(0.5, 0.5).setDepth(depth),
text: scene.add.text(x, y, text, {
font: textSize + 'pt 궁서'
font: textSize + 'pt 궁서',
align: 'center'
}).setDepth(depth).setOrigin(textOriginX, textOriginY).setColor(textColor),
space: {
......
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