Commit 881e1855 authored by 18손재민's avatar 18손재민 Committed by 18류지석

로그인 씬 분리 및 메인 메뉴 씬 wip

parent 8c3aaf8a
......@@ -28,9 +28,9 @@ socket.on('setId', function(msg) // {str, num playerNum}
// init game
socket.on('enterRoom', function()
{
Audio.killSound(ScenesData.menuScene, 'login');
game.scene.remove('menuScene');
game.scene.start('roomScene');
Audio.killSound(ScenesData.logInScene, 'login');
game.scene.remove('logInScene');
game.scene.start('mainMenuScene');
});
socket.on('syncRoomScene', function(msg)
......
......@@ -29,7 +29,7 @@ Input.gameSceneEnterReaction = function()
Input.isEntered = true;
}
}
Input.menuSceneEnterReaction = function()
Input.logInSceneEnterReaction = function()
{
Input.finalInput = Input.removeConVow(Input.finalInput);
if (Input.finalInput.length > 1)
......
var ScenesData = ScenesData || {};
var menuScene = new Phaser.Class(
var logInScene = new Phaser.Class(
{
Extends: Phaser.Scene,
initialize:
function menuScene ()
function logInScene ()
{
Phaser.Scene.call(this, {key: 'menuScene'});
Phaser.Scene.call(this, {key: 'logInScene'});
},
preload: function()
{
ScenesData.menuScene = this;
ScenesData.logInScene = this;
/*Input.inputField.loadImage(this);
ResourceLoader.loadBackGround(this);
Audio.loadSound(this);*/
......@@ -28,12 +28,35 @@ var menuScene = new Phaser.Class(
create: function()
{
Audio.loopSound(this, 'login');
Input.inputField.generate(this, Input.menuSceneEnterReaction);
Input.inputField.generate(this, Input.logInSceneEnterReaction);
BackGround.drawMenu(this);
}
});
var mainMenuScene = new Phaser.Class(
{
Extends: Phaser.Scene,
initialize:
function menuScene ()
{
Phaser.Scene.call(this, {key: 'mainMenuScene'});
},
preload: function()
{
ScenesData.mainMenuScene = this;
},
create: function()
{
this.myCharacter = scene.add.sprite(game.config.width / 2, game.config.height / 2, 'pyeongminStand').setDepth(5);
}
});
var roomScene = new Phaser.Class(
{
Extends: Phaser.Scene,
......
......@@ -14,7 +14,7 @@ var config = {
}
},
backgroundColor: Phaser.Display.Color.HexStringToColor('#F0CB85').color,//GetColor(245,208,138),
scene: [ menuScene, roomScene, gameScene ]
scene: [ logInScene, roomScene, gameScene ]
};
var game = null;
......
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