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
5268df2a
Commit
5268df2a
authored
Jul 17, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wordspace'
parents
12fc1bd9
cb78a829
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
14 deletions
+42
-14
Background.js
js/Background.js
+6
-0
Enums.js
js/Enums.js
+1
-0
ScenesData.js
js/ScenesData.js
+2
-7
WordObject.js
js/WordObject.js
+3
-3
WordSpace.js
js/WordSpace.js
+30
-4
No files found.
js/Background.js
View file @
5268df2a
var
BackGround
=
BackGround
||
{}
var
BackGround
=
BackGround
||
{}
BackGround
.
brainGroup
=
null
;
BackGround
.
brainGroup
=
null
;
BackGround
.
myCharacter
=
null
;
BackGround
.
loadImage
=
function
(
scene
)
BackGround
.
loadImage
=
function
(
scene
)
{
{
...
@@ -8,6 +9,11 @@ BackGround.loadImage = function(scene)
...
@@ -8,6 +9,11 @@ BackGround.loadImage = function(scene)
scene
.
load
.
image
(
'
menuBackground
'
,
'
assets/placeholder/menuBackground.png
'
)
scene
.
load
.
image
(
'
menuBackground
'
,
'
assets/placeholder/menuBackground.png
'
)
}
}
BackGround
.
drawCharacter
=
function
(
scene
)
{
BackGround
.
myCharacter
=
scene
.
add
.
sprite
(
640
,
615
,
'
pyeongminWrite
'
).
setScale
(
0.45
).
setDepth
(
2
);
}
BackGround
.
drawBrain
=
function
(
scene
)
BackGround
.
drawBrain
=
function
(
scene
)
{
{
brains
=
scene
.
add
.
sprite
(
640
,
360
,
'
brainGround
'
).
setDisplaySize
(
1282
,
722
).
setDepth
(
1
);
brains
=
scene
.
add
.
sprite
(
640
,
360
,
'
brainGround
'
).
setDisplaySize
(
1282
,
722
).
setDepth
(
1
);
...
...
js/Enums.js
0 → 100644
View file @
5268df2a
var
Enums
=
Enums
||
{};
\ No newline at end of file
js/ScenesData.js
View file @
5268df2a
...
@@ -95,8 +95,10 @@ var gameScene = new Phaser.Class(
...
@@ -95,8 +95,10 @@ var gameScene = new Phaser.Class(
create
:
function
()
create
:
function
()
{
{
WordSpace
.
loadAnimation
(
this
);
CSVParsing
.
CSVParse
(
this
);
CSVParsing
.
CSVParse
(
this
);
BackGround
.
drawBrain
(
this
);
BackGround
.
drawBrain
(
this
);
BackGround
.
drawCharacter
(
this
);
Audio
.
playSound
(
this
,
'
startGame
'
);
Audio
.
playSound
(
this
,
'
startGame
'
);
WordSpace
.
wordPhysicsGroup
=
this
.
physics
.
add
.
group
();
WordSpace
.
wordPhysicsGroup
=
this
.
physics
.
add
.
group
();
...
@@ -126,13 +128,6 @@ var gameScene = new Phaser.Class(
...
@@ -126,13 +128,6 @@ var gameScene = new Phaser.Class(
}
}
});
});
WordSpace
.
attackGauge
.
add
(
11
);
WordSpace
.
attackGauge
.
add
(
11
);
WordSpace
.
wordBreakAnim
=
this
.
anims
.
create
({
key
:
'
break
'
,
frames
:
this
.
anims
.
generateFrameNumbers
(
'
wordBreak
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
},
},
update
:
function
()
update
:
function
()
...
...
js/WordObject.js
View file @
5268df2a
...
@@ -70,7 +70,7 @@ class WordObject
...
@@ -70,7 +70,7 @@ class WordObject
const
forceIdx
=
WordSpace
.
wordForcedGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
const
forceIdx
=
WordSpace
.
wordForcedGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
forceIdx
>
-
1
)
WordSpace
.
wordForcedGroup
.
splice
(
forceIdx
,
1
);
if
(
forceIdx
>
-
1
)
WordSpace
.
wordForcedGroup
.
splice
(
forceIdx
,
1
);
WordSpace
.
wordPhysicsGroup
.
remove
(
this
.
physicsObj
);
WordSpace
.
wordPhysicsGroup
.
remove
(
this
.
physicsObj
);
let
breakAnim
=
ScenesData
.
gameScene
.
add
.
sprite
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
,
'
wordBreak
'
).
setScale
(
0.5
).
setDepth
(
3
).
play
(
'
break
'
);
let
breakAnim
=
ScenesData
.
gameScene
.
add
.
sprite
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
,
'
wordBreak
'
).
setScale
(
0.5
).
setDepth
(
3
).
play
(
'
wordBreakAnim
'
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
breakAnim
.
destroy
();
breakAnim
.
destroy
();
},
200
);
},
200
);
...
@@ -79,9 +79,9 @@ class WordObject
...
@@ -79,9 +79,9 @@ class WordObject
this
.
wordObj
.
destroy
();
this
.
wordObj
.
destroy
();
this
.
physicsObj
.
destroy
();
this
.
physicsObj
.
destroy
();
}
}
BackGround
.
myCharacter
.
play
(
WordSpace
.
pyeongminAnims
[
0
]);
}
}
attract
()
attract
()
{
{
if
(
!
this
.
moveStarted
)
if
(
!
this
.
moveStarted
)
...
...
js/WordSpace.js
View file @
5268df2a
var
WordSpace
=
WordSpace
||
{};
var
WordSpace
=
WordSpace
||
{};
WordSpace
.
test
=
null
;
// for test
// for test
WordSpace
.
weightTextObjForTest
=
null
;
WordSpace
.
weightTextObjForTest
=
null
;
WordSpace
.
nameWordTextForTest
=
null
;
WordSpace
.
nameWordTextForTest
=
null
;
...
@@ -14,7 +12,7 @@ WordSpace.totalWordNum = 0;
...
@@ -14,7 +12,7 @@ WordSpace.totalWordNum = 0;
WordSpace
.
brainCapacity
=
200
;
//수용 가능한 단어 무게 최대치
WordSpace
.
brainCapacity
=
200
;
//수용 가능한 단어 무게 최대치
WordSpace
.
gameTimer
=
null
;
//현재 게임 플레이 시간 타이머
WordSpace
.
gameTimer
=
null
;
//현재 게임 플레이 시간 타이머
WordSpace
.
isTimerOn
=
false
;
WordSpace
.
isTimerOn
=
false
;
WordSpace
.
wordBreakAnim
=
null
;
WordSpace
.
pyeongminAnims
=
[]
;
WordSpace
.
wordGroup
=
[];
WordSpace
.
wordGroup
=
[];
WordSpace
.
nameGroup
=
[];
WordSpace
.
nameGroup
=
[];
...
@@ -242,11 +240,38 @@ WordSpace.loadImage = function(scene)
...
@@ -242,11 +240,38 @@ WordSpace.loadImage = function(scene)
scene
.
load
.
image
(
'
strongBgr
'
+
i
,
'
assets/placeholder/strong
'
+
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
(
'
wordBreak
'
,
'
assets/image/word/wordbreak.png
'
,
{
frameWidth
:
180
,
frameHeight
:
180
});
scene
.
load
.
spritesheet
(
'
pyeongminWrite
'
,
'
assets/image/character/pyeongmin/write/pyeong_write.png
'
,
{
frameWidth
:
490
,
frameHeight
:
423
});
scene
.
load
.
spritesheet
(
'
pyeongminThrow
'
,
'
assets/image/character/pyeongmin/throw/pyeong_throw.png
'
,
{
frameWidth
:
490
,
frameHeight
:
423
});
WordSpace
.
weightTextObjForTest
=
scene
.
add
.
text
(
100
,
75
,
'
뇌의 무게: (현재) 0 /
'
+
this
.
brainCapacity
+
'
(전체)
'
).
setDepth
(
10
).
setColor
(
'
#000000
'
);
WordSpace
.
weightTextObjForTest
=
scene
.
add
.
text
(
100
,
75
,
'
뇌의 무게: (현재) 0 /
'
+
this
.
brainCapacity
+
'
(전체)
'
).
setDepth
(
10
).
setColor
(
'
#000000
'
);
WordSpace
.
killLogTextForTest
=
scene
.
add
.
text
(
1000
,
50
,
WordSpace
.
killLogForTest
).
setDepth
(
10
).
setColor
(
'
#000000
'
).
setAlign
(
'
right
'
);
WordSpace
.
killLogTextForTest
=
scene
.
add
.
text
(
1000
,
50
,
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
.
push
(
scene
.
anims
.
create
({
key
:
'
write
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminWrite
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
}));
WordSpace
.
pyeongminAnims
.
push
(
scene
.
anims
.
create
({
key
:
'
throw
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminThrow
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
}));
}
WordSpace
.
generateWord
=
WordSpace
.
generateWord
=
{
{
Normal
:
function
(
scene
,
grade
,
lenRate
)
Normal
:
function
(
scene
,
grade
,
lenRate
)
...
@@ -340,7 +365,7 @@ WordSpace.findWord = function(wordText)
...
@@ -340,7 +365,7 @@ WordSpace.findWord = function(wordText)
}
}
WordSpace
.
setPlayerTyping
.
add
(
wordText
);
WordSpace
.
setPlayerTyping
.
add
(
wordText
);
}
}
else
if
(
wordText
===
'
공격
'
&&
WordSpace
.
attackGauge
.
value
>=
3
)
// 공격모드 진입.
else
if
(
wordText
===
'
공격
'
&&
WordSpace
.
attackGauge
.
value
>=
3
&&
WordSpace
.
nameGroup
.
length
>
0
)
// 공격모드 진입.
{
{
console
.
log
(
'
attack mode
'
);
console
.
log
(
'
attack mode
'
);
Input
.
attackOption
=
this
.
attackGauge
.
getAttackOption
();
Input
.
attackOption
=
this
.
attackGauge
.
getAttackOption
();
...
@@ -425,6 +450,7 @@ WordSpace.attack = function(wordText, grade)
...
@@ -425,6 +450,7 @@ WordSpace.attack = function(wordText, grade)
WordSpace
.
attackGauge
.
resetValue
();
WordSpace
.
attackGauge
.
resetValue
();
WordSpace
.
setPlayerTyping
.
add
(
wordText
);
WordSpace
.
setPlayerTyping
.
add
(
wordText
);
BackGround
.
myCharacter
.
play
(
WordSpace
.
pyeongminAnims
[
1
]);
}
}
else
WordSpace
.
attackGauge
.
cutValue
(
0.3
);
else
WordSpace
.
attackGauge
.
cutValue
(
0.3
);
Input
.
maxInput
=
6
;
Input
.
maxInput
=
6
;
...
...
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