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
8c3aaf8a
Commit
8c3aaf8a
authored
Aug 04, 2019
by
18손재민
Committed by
18류지석
Aug 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이미지를 로딩하는 부분 분리
parent
ee94334c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
123 additions
and
114 deletions
+123
-114
GameServer.js
GameServer.js
+1
-1
index.html
index.html
+1
-0
Background.js
js/Background.js
+0
-8
ResourceLoader.js
js/ResourceLoader.js
+105
-0
ScenesData.js
js/ScenesData.js
+16
-7
WordSpace.js
js/WordSpace.js
+0
-98
No files found.
GameServer.js
View file @
8c3aaf8a
...
@@ -76,7 +76,7 @@ class GameRoom
...
@@ -76,7 +76,7 @@ class GameRoom
{
{
this
.
roomId
=
GameServer
.
getRoomNumber
();
this
.
roomId
=
GameServer
.
getRoomNumber
();
this
.
roomIndex
=
-
1
;
this
.
roomIndex
=
-
1
;
this
.
startCount
=
5
;
this
.
startCount
=
2
;
this
.
maxPlayer
=
100
;
this
.
maxPlayer
=
100
;
this
.
nextRank
=
100
;
this
.
nextRank
=
100
;
...
...
index.html
View file @
8c3aaf8a
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
<script
src=
"js/SelectWord.js"
></script>
<script
src=
"js/SelectWord.js"
></script>
<script
src=
"js/BGMsound.js"
></script>
<script
src=
"js/BGMsound.js"
></script>
<script
src=
"js/Enums.js"
></script>
<script
src=
"js/Enums.js"
></script>
<script
src=
"js/ResourceLoader.js"
></script>
<style>
<style>
img
{
position
:
relative
;
width
:
100%
;
height
:
100%
;
z-index
:
0
;}
img
{
position
:
relative
;
width
:
100%
;
height
:
100%
;
z-index
:
0
;}
...
...
js/Background.js
View file @
8c3aaf8a
...
@@ -11,14 +11,6 @@ BackGround.characterPos = [
...
@@ -11,14 +11,6 @@ BackGround.characterPos = [
]
]
BackGround
.
otherCharacters
=
[];
BackGround
.
otherCharacters
=
[];
BackGround
.
loadImage
=
function
(
scene
)
{
scene
.
load
.
image
(
'
brain
'
,
'
assets/image/background/brain.png
'
);
scene
.
load
.
image
(
'
gameBackground
'
,
'
assets/image/background/background_brain.png
'
);
scene
.
load
.
image
(
'
menuBackground
'
,
'
assets/placeholder/menuBackground.png
'
);
scene
.
load
.
image
(
'
roomBackground
'
,
'
assets/placeholder/roomBackground.png
'
);
}
BackGround
.
drawCharacter
=
function
(
scene
)
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
(
2
);
...
...
js/ResourceLoader.js
0 → 100644
View file @
8c3aaf8a
var
ResourceLoader
=
ResourceLoader
||
{};
ResourceLoader
.
loadBackGround
=
function
(
scene
)
{
scene
.
load
.
image
(
'
brain
'
,
'
assets/image/background/brain.png
'
);
scene
.
load
.
image
(
'
gameBackground
'
,
'
assets/image/background/background_brain.png
'
);
scene
.
load
.
image
(
'
menuBackground
'
,
'
assets/placeholder/menuBackground.png
'
);
scene
.
load
.
image
(
'
roomBackground
'
,
'
assets/placeholder/roomBackground.png
'
);
}
ResourceLoader
.
loadImage
=
function
(
scene
)
{
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
for
(
let
j
=
2
;
j
<
7
;
j
++
)
{
scene
.
load
.
image
((
'
wordBgr
'
+
i
+
'
_
'
+
j
),
(
'
assets/placeholder/
'
+
i
+
'
_
'
+
j
+
'
.png
'
));
}
}
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
scene
.
load
.
image
(
'
attackAlert
'
+
i
,
'
assets/placeholder/attackalert
'
+
(
i
+
1
)
+
'
.png
'
);
}
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
scene
.
load
.
image
(
'
item
'
+
i
,
'
assets/placeholder/item
'
+
i
+
'
.png
'
);
}
for
(
let
i
=
2
;
i
<
7
;
i
++
)
{
scene
.
load
.
image
(
'
nameBgr
'
+
i
,
'
assets/placeholder/name
'
+
i
+
'
.png
'
);
scene
.
load
.
image
(
'
strongBgr
'
+
i
,
'
assets/placeholder/strong
'
+
i
+
'
.png
'
);
}
scene
.
load
.
spritesheet
(
'
wordBreak
'
,
'
assets/image/word/wordbreak.png
'
,
{
frameWidth
:
180
,
frameHeight
:
180
});
scene
.
load
.
spritesheet
(
'
pyeongminSit
'
,
'
assets/image/character/pyeongmin/pyeong_sit.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminWrite
'
,
'
assets/image/character/pyeongmin/write/pyeong_write.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminThrow
'
,
'
assets/image/character/pyeongmin/throw/pyeong_throw.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminBurningSmall
'
,
'
assets/image/character/pyeongmin/burning/pyeong_burning_small.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminBurningBig
'
,
'
assets/image/character/pyeongmin/burning/pyeong_burning_big.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminGameOver
'
,
'
assets/image/character/pyeongmin/balladang/pyeong_balladang.png
'
,
{
frameWidth
:
720
,
frameHeight
:
700
});
scene
.
load
.
image
(
'
pyeongminStand
'
,
'
assets/image/character/pyeongmin/pyeong_stand.png
'
);
scene
.
load
.
image
(
'
phaseChangeBgr
'
,
'
assets/placeholder/phaseChange.png
'
);
scene
.
load
.
image
(
'
attackPaper
'
,
'
assets/image/etc/paper_crumbled.png
'
);
}
ResourceLoader
.
loadAnimation
=
function
(
scene
)
{
scene
.
anims
.
create
({
key
:
'
wordBreakAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
wordBreak
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
sit
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminSitAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminSit
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminWriteAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminWrite
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
notBurning
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminnotBurningAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminWrite
'
),
frameRate
:
10
,
repeat
:
-
1
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
smallBurning
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminsmallBurningAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminBurningSmall
'
),
frameRate
:
10
,
repeat
:
-
1
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
bigBurning
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminbigBurningAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminBurningBig
'
),
frameRate
:
10
,
repeat
:
-
1
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
throw
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminThrowAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminThrow
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
gameOver
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminGameOverAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminGameOver
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
}
\ No newline at end of file
js/ScenesData.js
View file @
8c3aaf8a
...
@@ -14,8 +14,14 @@ var menuScene = new Phaser.Class(
...
@@ -14,8 +14,14 @@ var menuScene = new Phaser.Class(
preload
:
function
()
preload
:
function
()
{
{
ScenesData
.
menuScene
=
this
;
ScenesData
.
menuScene
=
this
;
/*Input.inputField.loadImage(this);
ResourceLoader.loadBackGround(this);
Audio.loadSound(this);*/
ResourceLoader
.
loadBackGround
(
this
);
ResourceLoader
.
loadImage
(
this
);
Input
.
inputField
.
loadImage
(
this
);
Input
.
inputField
.
loadImage
(
this
);
BackGround
.
loadImage
(
this
);
CSVParsing
.
loadText
(
this
);
Audio
.
loadSound
(
this
);
Audio
.
loadSound
(
this
);
},
},
...
@@ -42,7 +48,7 @@ var roomScene = new Phaser.Class(
...
@@ -42,7 +48,7 @@ var roomScene = new Phaser.Class(
preload
:
function
()
preload
:
function
()
{
{
ScenesData
.
roomScene
=
this
;
ScenesData
.
roomScene
=
this
;
BackGround
.
loadImage
(
this
);
//ResourceLoader.loadBackGround
(this);
this
.
load
.
image
(
'
playerStand
'
,
'
assets/image/character/pyeongmin/pyeong_stand.png
'
);
this
.
load
.
image
(
'
playerStand
'
,
'
assets/image/character/pyeongmin/pyeong_stand.png
'
);
},
},
...
@@ -105,7 +111,7 @@ var roomScene = new Phaser.Class(
...
@@ -105,7 +111,7 @@ var roomScene = new Phaser.Class(
this
.
countText
.
setText
(
'
사람들을 위해 대기중입니다...
'
);
this
.
countText
.
setText
(
'
사람들을 위해 대기중입니다...
'
);
}
}
}
}
})
})
;
var
gameScene
=
new
Phaser
.
Class
(
var
gameScene
=
new
Phaser
.
Class
(
{
{
...
@@ -121,18 +127,21 @@ var gameScene = new Phaser.Class(
...
@@ -121,18 +127,21 @@ var gameScene = new Phaser.Class(
preload
:
function
()
preload
:
function
()
{
{
ScenesData
.
gameScene
=
this
;
ScenesData
.
gameScene
=
this
;
BackGround
.
loadImage
(
this
);
/*ResourceLoader.loadBackGround
(this);
WordSpace
.
loadImage
(
this
);
ResourceLoader
.loadImage(this);
Input.inputField.loadImage(this);
Input.inputField.loadImage(this);
CSVParsing.loadText(this);
CSVParsing.loadText(this);
Audio
.
loadSound
(
this
);
Audio.loadSound(this);*/
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
'
);
},
},
create
:
function
()
create
:
function
()
{
{
WordSpace
.
gameTimer
=
new
Phaser
.
Time
.
Clock
(
this
);
WordSpace
.
gameTimer
=
new
Phaser
.
Time
.
Clock
(
this
);
WordSpace
.
gameTimer
.
start
();
WordSpace
.
gameTimer
.
start
();
WordSpace
.
loadAnimation
(
this
);
ResourceLoader
.
loadAnimation
(
this
);
CSVParsing
.
CSVParse
(
this
);
CSVParsing
.
CSVParse
(
this
);
BackGround
.
drawBrain
(
this
);
BackGround
.
drawBrain
(
this
);
BackGround
.
drawCharacter
(
this
);
BackGround
.
drawCharacter
(
this
);
...
...
js/WordSpace.js
View file @
8c3aaf8a
...
@@ -168,104 +168,6 @@ WordSpace.genWordByProb = function(scene)
...
@@ -168,104 +168,6 @@ WordSpace.genWordByProb = function(scene)
//WordSpace.generateWord(scene, SelectWord.selectWord(wordIdx));
//WordSpace.generateWord(scene, SelectWord.selectWord(wordIdx));
}
}
WordSpace
.
loadImage
=
function
(
scene
)
{
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
for
(
let
j
=
2
;
j
<
7
;
j
++
)
{
scene
.
load
.
image
((
'
wordBgr
'
+
i
+
'
_
'
+
j
),
(
'
assets/placeholder/
'
+
i
+
'
_
'
+
j
+
'
.png
'
));
}
}
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
scene
.
load
.
image
(
'
attackAlert
'
+
i
,
'
assets/placeholder/attackalert
'
+
(
i
+
1
)
+
'
.png
'
);
}
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
scene
.
load
.
image
(
'
item
'
+
i
,
'
assets/placeholder/item
'
+
i
+
'
.png
'
);
}
for
(
let
i
=
2
;
i
<
7
;
i
++
)
{
scene
.
load
.
image
(
'
nameBgr
'
+
i
,
'
assets/placeholder/name
'
+
i
+
'
.png
'
);
scene
.
load
.
image
(
'
strongBgr
'
+
i
,
'
assets/placeholder/strong
'
+
i
+
'
.png
'
);
}
scene
.
load
.
spritesheet
(
'
wordBreak
'
,
'
assets/image/word/wordbreak.png
'
,
{
frameWidth
:
180
,
frameHeight
:
180
});
scene
.
load
.
spritesheet
(
'
pyeongminSit
'
,
'
assets/image/character/pyeongmin/pyeong_sit.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminWrite
'
,
'
assets/image/character/pyeongmin/write/pyeong_write.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminThrow
'
,
'
assets/image/character/pyeongmin/throw/pyeong_throw.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminBurningSmall
'
,
'
assets/image/character/pyeongmin/burning/pyeong_burning_small.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminBurningBig
'
,
'
assets/image/character/pyeongmin/burning/pyeong_burning_big.png
'
,
{
frameWidth
:
521
,
frameHeight
:
610
});
scene
.
load
.
spritesheet
(
'
pyeongminGameOver
'
,
'
assets/image/character/pyeongmin/balladang/pyeong_balladang.png
'
,
{
frameWidth
:
720
,
frameHeight
:
700
});
scene
.
load
.
image
(
'
phaseChangeBgr
'
,
'
assets/placeholder/phaseChange.png
'
);
scene
.
load
.
image
(
'
attackPaper
'
,
'
assets/image/etc/paper_crumbled.png
'
);
WordSpace
.
weightTextObjForTest
=
scene
.
add
.
text
(
game
.
config
.
width
*
5
/
64
,
game
.
config
.
height
*
5
/
48
,
'
뇌의 무게: (현재) 0 /
'
+
this
.
brainCapacity
+
'
(전체)
'
).
setDepth
(
10
).
setColor
(
'
#000000
'
);
WordSpace
.
killLogTextForTest
=
scene
.
add
.
text
(
game
.
config
.
width
*
25
/
32
,
game
.
config
.
height
*
5
/
72
,
WordSpace
.
killLogForTest
).
setDepth
(
10
).
setColor
(
'
#000000
'
).
setAlign
(
'
right
'
);
}
WordSpace
.
loadAnimation
=
function
(
scene
)
{
scene
.
anims
.
create
({
key
:
'
wordBreakAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
wordBreak
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
sit
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminSitAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminSit
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminWriteAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminWrite
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
notBurning
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminnotBurningAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminWrite
'
),
frameRate
:
10
,
repeat
:
-
1
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
smallBurning
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminsmallBurningAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminBurningSmall
'
),
frameRate
:
10
,
repeat
:
-
1
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
bigBurning
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminbigBurningAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminBurningBig
'
),
frameRate
:
10
,
repeat
:
-
1
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
throw
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminThrowAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminThrow
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
gameOver
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminGameOverAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminGameOver
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
}
WordSpace
.
generateWord
=
WordSpace
.
generateWord
=
{
{
Normal
:
function
(
scene
,
grade
,
lenRate
)
Normal
:
function
(
scene
,
grade
,
lenRate
)
...
...
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