Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
881e1855
Commit
881e1855
authored
Aug 04, 2019
by
18손재민
Committed by
18류지석
Aug 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
로그인 씬 분리 및 메인 메뉴 씬 wip
parent
8c3aaf8a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
10 deletions
+33
-10
Client.js
js/Client.js
+3
-3
Input.js
js/Input.js
+1
-1
ScenesData.js
js/ScenesData.js
+28
-5
main.js
js/main.js
+1
-1
No files found.
js/Client.js
View file @
881e1855
...
@@ -28,9 +28,9 @@ socket.on('setId', function(msg) // {str, num playerNum}
...
@@ -28,9 +28,9 @@ socket.on('setId', function(msg) // {str, num playerNum}
// init game
// init game
socket
.
on
(
'
enterRoom
'
,
function
()
socket
.
on
(
'
enterRoom
'
,
function
()
{
{
Audio
.
killSound
(
ScenesData
.
menu
Scene
,
'
login
'
);
Audio
.
killSound
(
ScenesData
.
logIn
Scene
,
'
login
'
);
game
.
scene
.
remove
(
'
menu
Scene
'
);
game
.
scene
.
remove
(
'
logIn
Scene
'
);
game
.
scene
.
start
(
'
room
Scene
'
);
game
.
scene
.
start
(
'
mainMenu
Scene
'
);
});
});
socket
.
on
(
'
syncRoomScene
'
,
function
(
msg
)
socket
.
on
(
'
syncRoomScene
'
,
function
(
msg
)
...
...
js/Input.js
View file @
881e1855
...
@@ -29,7 +29,7 @@ Input.gameSceneEnterReaction = function()
...
@@ -29,7 +29,7 @@ Input.gameSceneEnterReaction = function()
Input
.
isEntered
=
true
;
Input
.
isEntered
=
true
;
}
}
}
}
Input
.
menu
SceneEnterReaction
=
function
()
Input
.
logIn
SceneEnterReaction
=
function
()
{
{
Input
.
finalInput
=
Input
.
removeConVow
(
Input
.
finalInput
);
Input
.
finalInput
=
Input
.
removeConVow
(
Input
.
finalInput
);
if
(
Input
.
finalInput
.
length
>
1
)
if
(
Input
.
finalInput
.
length
>
1
)
...
...
js/ScenesData.js
View file @
881e1855
var
ScenesData
=
ScenesData
||
{};
var
ScenesData
=
ScenesData
||
{};
var
menu
Scene
=
new
Phaser
.
Class
(
var
logIn
Scene
=
new
Phaser
.
Class
(
{
{
Extends
:
Phaser
.
Scene
,
Extends
:
Phaser
.
Scene
,
initialize
:
initialize
:
function
menu
Scene
()
function
logIn
Scene
()
{
{
Phaser
.
Scene
.
call
(
this
,
{
key
:
'
menu
Scene
'
});
Phaser
.
Scene
.
call
(
this
,
{
key
:
'
logIn
Scene
'
});
},
},
preload
:
function
()
preload
:
function
()
{
{
ScenesData
.
menu
Scene
=
this
;
ScenesData
.
logIn
Scene
=
this
;
/*Input.inputField.loadImage(this);
/*Input.inputField.loadImage(this);
ResourceLoader.loadBackGround(this);
ResourceLoader.loadBackGround(this);
Audio.loadSound(this);*/
Audio.loadSound(this);*/
...
@@ -28,12 +28,35 @@ var menuScene = new Phaser.Class(
...
@@ -28,12 +28,35 @@ var menuScene = new Phaser.Class(
create
:
function
()
create
:
function
()
{
{
Audio
.
loopSound
(
this
,
'
login
'
);
Audio
.
loopSound
(
this
,
'
login
'
);
Input
.
inputField
.
generate
(
this
,
Input
.
menu
SceneEnterReaction
);
Input
.
inputField
.
generate
(
this
,
Input
.
logIn
SceneEnterReaction
);
BackGround
.
drawMenu
(
this
);
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
(
var
roomScene
=
new
Phaser
.
Class
(
{
{
Extends
:
Phaser
.
Scene
,
Extends
:
Phaser
.
Scene
,
...
...
js/main.js
View file @
881e1855
...
@@ -14,7 +14,7 @@ var config = {
...
@@ -14,7 +14,7 @@ var config = {
}
}
},
},
backgroundColor
:
Phaser
.
Display
.
Color
.
HexStringToColor
(
'
#F0CB85
'
).
color
,
//GetColor(245,208,138),
backgroundColor
:
Phaser
.
Display
.
Color
.
HexStringToColor
(
'
#F0CB85
'
).
color
,
//GetColor(245,208,138),
scene
:
[
menu
Scene
,
roomScene
,
gameScene
]
scene
:
[
logIn
Scene
,
roomScene
,
gameScene
]
};
};
var
game
=
null
;
var
game
=
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment