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
008e21b6
Commit
008e21b6
authored
Jul 18, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
반격시간 표시 wip, 현재 반격 시간 표시 마스크가 단어 크기와 맞지 않는 이슈 있음
parent
93ded99d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
13 deletions
+30
-13
ScenesData.js
js/ScenesData.js
+2
-0
WordObject.js
js/WordObject.js
+28
-11
WordSpace.js
js/WordSpace.js
+0
-2
No files found.
js/ScenesData.js
View file @
008e21b6
...
...
@@ -95,6 +95,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 @
008e21b6
...
...
@@ -53,6 +53,7 @@ class WordObject
});
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
();
...
...
@@ -145,8 +146,9 @@ 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
);
}
...
...
@@ -154,24 +156,39 @@ class AttackWord extends WordObject
{
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
.
physicsObj
.
scale
);
.
setTint
(
Phaser
.
Display
.
Color
.
GetColor
(
120
,
120
,
120
)).
setScale
(
this
.
scale
);
this
.
maskBackground
.
alpha
=
0.5
;
console
.
log
(
'
scale
'
+
this
.
scale
);
console
.
log
(
'
this.physicsObj.width
'
+
this
.
physicsObj
.
width
);
console
.
log
(
'
this.physicsObj.height
'
+
this
.
physicsObj
.
height
);
console
.
log
(
'
this.physicsObj.body.width
'
+
this
.
physicsObj
.
body
.
width
);
console
.
log
(
'
this.physicsObj.body.height
'
+
this
.
physicsObj
.
body
.
height
);
this
.
shape
=
scene
.
make
.
graphics
();
var
rect
=
new
Phaser
.
Geom
.
Rectangle
(
0
,
0
,
this
.
maskBackground
.
width
,
this
.
maskBackground
.
height
);
this
.
shape
.
fillStyle
(
0xffffff
);
this
.
shape
.
fillRectShape
(
rect
);
var
rect
=
new
Phaser
.
Geom
.
Rectangle
(
0
,
0
,
this
.
physicsObj
.
width
,
this
.
physicsObj
.
height
);
console
.
log
(
rect
);
console
.
log
(
this
.
shape
);
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
;
}
attract
()
{
super
.
attract
();
if
(
WordSpace
.
gameTimer
.
now
<
this
.
counterTime
)
{
this
.
maskBackground
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
);
this
.
mask
.
x
=
this
.
physicsObj
.
x
;
this
.
mask
.
y
=
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
/
2
;
this
.
shape
.
y
=
this
.
physicsObj
.
y
-
this
.
physicsObj
.
height
/
2
;
}
else
if
(
this
.
maskBackground
!=
null
)
this
.
maskBackground
.
destroy
();
}
destroy
()
{
switch
(
this
.
wordGrade
)
...
...
@@ -188,7 +205,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
();
}
}
...
...
js/WordSpace.js
View file @
008e21b6
...
...
@@ -426,8 +426,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
'
);
}
}
...
...
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