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
90f702d6
Commit
90f702d6
authored
Jul 06, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
공격 단어 생성 함수 수정
parent
93dde5b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
WordObject.js
js/WordObject.js
+7
-4
WordSpace.js
js/WordSpace.js
+3
-8
No files found.
js/WordObject.js
View file @
90f702d6
...
@@ -67,15 +67,18 @@ class WordObject
...
@@ -67,15 +67,18 @@ class WordObject
class
AttackWord
extends
WordObject
class
AttackWord
extends
WordObject
{
{
constructor
(
text
,
isStrong
)
constructor
(
text
,
_wordGrade
,
isStrong
)
{
{
super
(
text
);
super
(
text
);
this
.
wordGrade
=
_wordGrade
;
this
.
wordWeight
=
WordReader
.
getWordWeight
(
this
.
wordGrade
);
if
(
WordReader
.
getWordTyping
(
playerName
)
<=
9
)
if
(
WordReader
.
getWordTyping
(
playerName
)
<=
9
)
this
.
wordWeight
+=
this
.
wordWeight
*
0.2
*
(
WordReader
.
getWordTyping
(
playerName
)
-
9
);
this
.
wordWeight
+=
this
.
wordWeight
*
0.2
*
(
WordReader
.
getWordTyping
(
playerName
)
-
9
);
this
.
wordWeight
*=
isStrong
?
3
:
2
;
this
.
wordWeight
*=
isStrong
?
3
:
2
;
this
.
attacker
=
playerNum
;
this
.
attacker
=
playerNum
;
this
.
attackedTime
=
WordSpace
.
gameTimer
.
now
;
this
.
attackedTime
=
WordSpace
.
gameTimer
.
now
;
console
.
log
(
'
Attack text :
'
+
text
+
'
, Attacker :
'
+
_attacker
);
console
.
log
(
'
Attack text :
'
+
text
+
'
, Attacker :
'
+
this
.
attacker
+
'
, Weight :
'
+
this
.
wordWeight
);
console
.
log
(
'
Attacked time :
'
+
this
.
attackedTime
);
}
}
}
}
...
@@ -86,6 +89,6 @@ class NameWord extends WordObject
...
@@ -86,6 +89,6 @@ class NameWord extends WordObject
super
(
text
);
super
(
text
);
this
.
wordWeight
=
2
;
this
.
wordWeight
=
2
;
this
.
isStrong
=
_isStrong
;
this
.
isStrong
=
_isStrong
;
console
.
log
(
'
Attack text :
'
+
text
+
'
, Attacker :
'
+
_attacker
);
console
.
log
(
'
Name :
'
+
text
+
'
, Strong :
'
+
this
.
isStrong
+
'
, Weight :
'
+
this
.
wordWeight
);
}
}
}
}
js/WordSpace.js
View file @
90f702d6
...
@@ -236,14 +236,9 @@ WordSpace.loadImage = function(scene)
...
@@ -236,14 +236,9 @@ WordSpace.loadImage = function(scene)
WordSpace
.
weightTextObjForTest
=
scene
.
add
.
text
(
100
,
75
,
'
뇌의 무게: (현재) 0 / 100 (전체)
'
).
setDepth
(
10
).
setColor
(
'
#000000
'
);
WordSpace
.
weightTextObjForTest
=
scene
.
add
.
text
(
100
,
75
,
'
뇌의 무게: (현재) 0 / 100 (전체)
'
).
setDepth
(
10
).
setColor
(
'
#000000
'
);
}
}
WordSpace
.
generateWord
=
function
(
scene
,
wordText
,
grade
,
lenRate
,
attacker
=
null
)
WordSpace
.
generateWord
=
function
(
scene
,
wordText
,
grade
,
lenRate
,
isStrong
)
{
{
if
(
attacker
!=
null
)
if
(
isStrong
!=
undefined
)
word
=
new
AttackWord
(
wordText
,
grade
,
isStrong
);
{
console
.
log
(
'
d
'
);
word
=
new
AttackWord
(
wordText
,
attacker
);
}
else
word
=
new
WordObject
(
wordText
);
else
word
=
new
WordObject
(
wordText
);
if
(
typeof
grade
==
'
number
'
)
if
(
typeof
grade
==
'
number
'
)
{
{
...
@@ -361,7 +356,7 @@ WordSpace.attack = function(wordText, grade)
...
@@ -361,7 +356,7 @@ WordSpace.attack = function(wordText, grade)
if
(
wordText
!=
''
)
if
(
wordText
!=
''
)
{
{
console
.
log
(
'
attack
'
+
wordText
+
'
, grade:
'
+
grade
);
console
.
log
(
'
attack
'
+
wordText
+
'
, grade:
'
+
grade
);
WordSpace
.
generateWord
(
WordSpace
.
gameSceneForTest
,
wordText
,
grade
,
playerNum
);
// for test
WordSpace
.
generateWord
(
WordSpace
.
gameSceneForTest
,
wordText
,
grade
,
undefined
,
true
);
// for test
// 이부분에서 게이지에 따라 급수 결정
// 이부분에서 게이지에 따라 급수 결정
// 이걸 서버로 공격을 보내야 함
// 이걸 서버로 공격을 보내야 함
// 이부분은 서버 잘써야함
// 이부분은 서버 잘써야함
...
...
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