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
3050301f
Commit
3050301f
authored
Jul 18, 2019
by
18신대성
Committed by
Chae Ho Shin
Jul 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'server' of
https://git.kucatdog.net/tear-of-sejong/sejong25
into server
parents
0d4ff0b4
cfa46b01
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
16 deletions
+61
-16
index.html
index.html
+1
-0
Enums.js
js/Enums.js
+3
-1
ScenesData.js
js/ScenesData.js
+2
-0
WordObject.js
js/WordObject.js
+39
-6
WordSpace.js
js/WordSpace.js
+16
-9
No files found.
index.html
View file @
3050301f
...
...
@@ -14,6 +14,7 @@
<script
src=
"js/CSVParsing.js"
></script>
<script
src=
"js/SelectWord.js"
></script>
<script
src=
"js/BGMsound.js"
></script>
<script
src=
"js/Enums.js"
></script>
</head>
<body>
<script
src=
"js/Client.js"
></script>
...
...
js/Enums.js
View file @
3050301f
var
Enums
=
Enums
||
{};
\ No newline at end of file
var
Enums
=
Enums
||
{};
Enums
.
characterAnim
=
{
write
:
0
,
attackWrite
:
1
,
throw
:
2
,
hit
:
3
}
\ No newline at end of file
js/ScenesData.js
View file @
3050301f
...
...
@@ -109,6 +109,8 @@ var gameScene = new Phaser.Class(
create
:
function
()
{
WordSpace
.
gameTimer
=
new
Phaser
.
Time
.
Clock
(
this
);
WordSpace
.
gameTimer
.
start
();
WordSpace
.
loadAnimation
(
this
);
CSVParsing
.
CSVParse
(
this
);
BackGround
.
drawBrain
(
this
);
...
...
js/WordObject.js
View file @
3050301f
...
...
@@ -49,10 +49,11 @@ class WordObject
{
fontSize
:
(
this
.
scale
*
this
.
fontScale
)
+
'
pt
'
,
fontFamily
:
'
"궁서", 궁서체, serif
'
,
fontStyle
:
(
this
.
wordWeight
>
5
?
'
bold
'
:
''
)
//
fontStyle: (this.wordWeight > 5 ? 'bold' : '')
});
if
(
!
this
.
isNameWord
)
this
.
wordObj
.
setColor
(
'
#000000
'
).
setOrigin
(
0.5
,
0.5
);
else
this
.
wordObj
.
setColor
(
'
#ffffff
'
).
setOrigin
(
0.45
,
0.5
);
this
.
createdTime
=
WordSpace
.
gameTimer
.
now
;
WordSpace
.
totalWeight
+=
this
.
wordWeight
;
WordSpace
.
totalWordNum
+=
1
;
WordSpace
.
setGameOverTimer
();
...
...
@@ -79,7 +80,7 @@ class WordObject
this
.
wordObj
.
destroy
();
this
.
physicsObj
.
destroy
();
}
BackGround
.
myCharacter
.
play
(
WordSpace
.
pyeongminAnims
[
0
]);
BackGround
.
myCharacter
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]);
}
attract
()
...
...
@@ -145,11 +146,42 @@ class AttackWord extends WordObject
this
.
wordWeight
+=
this
.
wordWeight
*
0.2
*
(
WordReader
.
getWordTyping
(
_playerData
.
nickname
)
-
9
);
this
.
wordWeight
*=
isStrong
?
3
:
2
;
this
.
attacker
=
_playerData
;
this
.
counterTime
=
WordSpace
.
gameTimer
.
now
+
1000
*
(
this
.
wordTyping
<=
(
5
-
_wordGrade
)
*
2.5
?
this
.
wordTyping
/
(
Math
.
max
(
200
,
WordSpace
.
playerTyping
)
/
60
)
*
1.5
:
((
5
-
_wordGrade
)
*
3
+
(
this
.
wordTyping
-
(
5
-
_wordGrade
)
*
2.5
)
*
2.5
)
/
(
Math
.
max
(
200
,
WordSpace
.
playerTyping
)
/
60
)
*
1.5
);
/*this.counterTime = WordSpace.gameTimer.now + 1000 * (this.wordTyping <= (5 - _wordGrade) * 2.5 ? this.wordTyping / (Math.max(200, WordSpace.playerTyping) / 60) * 1.5 :
((5 - _wordGrade) * 3 + (this.wordTyping - (5 - _wordGrade) * 2.5) * 2.5) / (Math.max(200, WordSpace.playerTyping) / 60) * 1.5);*/
this
.
counterTime
=
WordSpace
.
gameTimer
.
now
+
10000
;
console
.
log
(
'
Attack text :
'
+
text
+
'
, Attacker :
'
+
this
.
attacker
.
nickname
+
'
, Weight :
'
+
this
.
wordWeight
);
console
.
log
(
'
Counter time :
'
+
this
.
counterTime
);
}
instantiate
(
scene
,
lenRate
)
{
super
.
instantiate
(
scene
,
lenRate
);
this
.
maskBackground
=
scene
.
physics
.
add
.
sprite
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
,
'
wordBgr
'
+
this
.
wordGrade
+
'
_
'
+
Math
.
min
(
Math
.
max
(
2
,
this
.
wordText
.
length
),
6
))
.
setTint
(
Phaser
.
Display
.
Color
.
GetColor
(
120
,
120
,
120
)).
setScale
(
this
.
scale
);
this
.
maskBackground
.
alpha
=
0.5
;
this
.
shape
=
scene
.
make
.
graphics
();
var
rect
=
new
Phaser
.
Geom
.
Rectangle
(
0
,
0
,
this
.
maskBackground
.
width
*
this
.
scale
,
this
.
maskBackground
.
height
*
this
.
scale
);
this
.
shape
.
fillStyle
(
0xffffff
).
fillRectShape
(
rect
);
this
.
mask
=
this
.
shape
.
createGeometryMask
();
this
.
maskBackground
.
setMask
(
this
.
mask
);
this
.
maskStart
=
this
.
physicsObj
.
x
;
this
.
maskEnd
=
this
.
physicsObj
.
x
-
this
.
physicsObj
.
width
*
this
.
scale
;
}
attract
()
{
super
.
attract
();
if
(
WordSpace
.
gameTimer
.
now
<
this
.
counterTime
)
{
this
.
maskBackground
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
);
this
.
shape
.
x
=
this
.
physicsObj
.
x
+
(
this
.
maskEnd
-
this
.
maskStart
)
*
((
WordSpace
.
gameTimer
.
now
-
this
.
createdTime
)
/
(
this
.
counterTime
-
this
.
createdTime
))
-
this
.
physicsObj
.
width
*
this
.
scale
/
2
;
this
.
shape
.
y
=
this
.
physicsObj
.
y
-
this
.
physicsObj
.
height
*
this
.
scale
/
2
;
}
else
if
(
this
.
maskBackground
!=
null
)
this
.
maskBackground
.
destroy
();
}
destroy
()
{
switch
(
this
.
wordGrade
)
...
...
@@ -166,7 +198,7 @@ class AttackWord extends WordObject
let
tempWord
=
WordSpace
.
generateWord
.
Name
(
ScenesData
.
gameScene
,
true
,
this
.
attacker
);
tempWord
.
destroy
();
}
//WordSpace.nameGroup.push(new NameWord(this.attacker, true)
);
if
(
this
.
maskBackground
!=
null
)
this
.
maskBackground
.
destroy
(
);
super
.
destroy
();
}
}
...
...
@@ -185,7 +217,8 @@ class NameWord extends WordObject
attract
()
{
if
(
this
.
isActive
)
super
.
attract
();
else
{
else
{
this
.
path
.
getPoint
(
this
.
follower
.
t
,
this
.
follower
.
vec
);
this
.
physicsObj
.
setPosition
(
this
.
follower
.
vec
.
x
,
this
.
follower
.
vec
.
y
);
this
.
wordObj
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
);
...
...
js/WordSpace.js
View file @
3050301f
...
...
@@ -210,20 +210,27 @@ WordSpace.loadAnimation = function(scene)
repeat
:
0
,
hideOnComplete
:
false
});
WordSpace
.
pyeongminAnims
.
push
(
scene
.
anims
.
create
({
key
:
'
write
'
,
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminWriteAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminWrite
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
}));
WordSpace
.
pyeongminAnims
.
push
(
scene
.
anims
.
create
({
key
:
'
throw
'
,
});
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
attackWrite
]
=
scene
.
anims
.
create
({
key
:
'
pyeongminattackWriteAnim
'
,
frames
:
scene
.
anims
.
generateFrameNumbers
(
'
pyeongminWrite
'
),
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
.
generateWord
=
...
...
@@ -327,6 +334,8 @@ WordSpace.findWord = function(wordText)
Input
.
attackMode
=
true
;
WordSpace
.
attackGauge
.
pauseCycle
(
true
);
WordSpace
.
setPlayerTyping
.
add
(
wordText
);
BackGround
.
myCharacter
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
attackWrite
]);
BackGround
.
myCharacter
.
anims
.
msPerFrame
/=
(
4
-
WordSpace
.
attackGauge
.
getAttackOption
().
wordGrade
);
}
else
// 오타 체크
{
...
...
@@ -371,8 +380,6 @@ WordSpace.setPlayerTyping =
},
initiate
:
function
(
scene
)
{
WordSpace
.
gameTimer
=
new
Phaser
.
Time
.
Clock
(
scene
);
WordSpace
.
gameTimer
.
start
();
this
.
text
=
scene
.
add
.
text
(
100
,
200
,
'
현재 타수 :
'
+
WordSpace
.
playerTyping
.
toFixed
(
1
)).
setDepth
(
10
).
setColor
(
'
#000000
'
);
}
}
...
...
@@ -405,7 +412,7 @@ WordSpace.attack = function(wordText, grade)
WordSpace
.
attackGauge
.
resetValue
();
WordSpace
.
setPlayerTyping
.
add
(
wordText
);
BackGround
.
myCharacter
.
play
(
WordSpace
.
pyeongminAnims
[
1
]);
BackGround
.
myCharacter
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
throw
]);
}
else
WordSpace
.
attackGauge
.
cutValue
(
0.3
);
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