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
93dde5b8
Commit
93dde5b8
authored
Jul 06, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
호패 클래스 및 플레이어 닉네임 만듬
parent
c57b65f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
WordObject.js
js/WordObject.js
+17
-3
main.js
js/main.js
+6
-1
No files found.
js/WordObject.js
View file @
93dde5b8
...
...
@@ -67,11 +67,25 @@ class WordObject
class
AttackWord
extends
WordObject
{
constructor
(
text
,
_attacker
)
constructor
(
text
,
isStrong
)
{
super
(
text
);
this
.
attacker
=
_attacker
;
if
(
WordReader
.
getWordTyping
(
playerName
)
<=
9
)
this
.
wordWeight
+=
this
.
wordWeight
*
0.2
*
(
WordReader
.
getWordTyping
(
playerName
)
-
9
);
this
.
wordWeight
*=
isStrong
?
3
:
2
;
this
.
attacker
=
playerNum
;
this
.
attackedTime
=
WordSpace
.
gameTimer
.
now
;
console
.
log
(
'
Attack text :
'
+
text
+
'
, Attacker :
'
+
_attacker
);
}
}
\ No newline at end of file
}
class
NameWord
extends
WordObject
{
constructor
(
text
,
_isStrong
=
false
)
{
super
(
text
);
this
.
wordWeight
=
2
;
this
.
isStrong
=
_isStrong
;
console
.
log
(
'
Attack text :
'
+
text
+
'
, Attacker :
'
+
_attacker
);
}
}
js/main.js
View file @
93dde5b8
...
...
@@ -13,7 +13,12 @@ var config = {
};
var
game
=
new
Phaser
.
Game
(
config
)
var
playerNum
=
-
1
;
//플레이어 정보, 서버 통신시 필요할 듯
//테스트용이므로 차후 수정 요망
var
playerNum
=
-
1
;
//플레이어 아이디, 고유 번호
var
playerName
=
'
임시아이디
'
//플레이어 닉네임
// client side
var
socket
=
io
.
connect
();
...
...
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