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
767e7af6
Commit
767e7af6
authored
Jul 13, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 호패를 입력하면 호패가 하단에 쌓이고, 공격하면 호패가 사라짐. 강호패는 wip
parent
de364cdb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
+23
-2
GameServer.js
GameServer.js
+1
-1
Client.js
js/Client.js
+1
-0
WordObject.js
js/WordObject.js
+19
-1
WordSpace.js
js/WordSpace.js
+2
-0
No files found.
GameServer.js
View file @
767e7af6
var
GameServer
=
GameServer
||
{};
var
GameServer
=
GameServer
||
{};
GameServer
.
Phase
=
{
READY
:
0
,
START
:
1
,
MAIN
:
2
,
MUSIC
:
3
};
GameServer
.
Phase
=
{
READY
:
0
,
START
:
1
,
MAIN
:
2
,
MUSIC
:
3
};
GameServer
.
startCount
=
4
;
GameServer
.
startCount
=
2
;
GameServer
.
currentPlayer
=
[];
GameServer
.
currentPlayer
=
[];
GameServer
.
playingRoom
=
[];
GameServer
.
playingRoom
=
[];
...
...
js/Client.js
View file @
767e7af6
...
@@ -53,6 +53,7 @@ socket.on('defeat', function(msg) // object player
...
@@ -53,6 +53,7 @@ socket.on('defeat', function(msg) // object player
socket
.
on
(
'
attackSucceed
'
,
function
(
msg
)
socket
.
on
(
'
attackSucceed
'
,
function
(
msg
)
{
{
WordSpace
.
nameGroup
.
push
(
new
NameWord
(
msg
.
victim
,
true
));
WordSpace
.
nameGroup
.
push
(
new
NameWord
(
msg
.
victim
,
true
));
});
});
...
...
js/WordObject.js
View file @
767e7af6
...
@@ -172,12 +172,30 @@ class NameWord extends WordObject
...
@@ -172,12 +172,30 @@ class NameWord extends WordObject
this
.
ownerId
=
player
.
id
;
this
.
ownerId
=
player
.
id
;
this
.
wordWeight
=
2
;
this
.
wordWeight
=
2
;
this
.
isStrong
=
_isStrong
;
this
.
isStrong
=
_isStrong
;
this
.
isActive
=
true
;
console
.
log
(
'
Name :
'
+
player
.
nickname
+
'
, Strong :
'
+
this
.
isStrong
+
'
, Weight :
'
+
this
.
wordWeight
);
console
.
log
(
'
Name :
'
+
player
.
nickname
+
'
, Strong :
'
+
this
.
isStrong
+
'
, Weight :
'
+
this
.
wordWeight
);
}
}
attract
()
{
if
(
this
.
isActive
)
super
.
attract
();
}
destroy
()
destroy
()
{
{
WordSpace
.
attackGauge
.
add
(
this
.
wordTyping
*
0.1
);
WordSpace
.
attackGauge
.
add
(
this
.
wordTyping
*
0.1
);
WordSpace
.
nameGroup
.
push
(
this
);
WordSpace
.
nameGroup
.
push
(
this
);
super
.
destroy
();
this
.
isActive
=
false
;
this
.
physicsObj
.
setVelocity
(
0
,
0
);
this
.
physicsObj
.
setPosition
(
100
+
WordSpace
.
nameGroup
.
length
*
50
,
650
).
setDepth
(
2
);
this
.
wordObj
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
).
setDepth
(
2
);
console
.
log
(
this
.
generationCode
+
'
:
'
+
this
.
wordText
+
'
destroyed
'
);
WordSpace
.
totalWeight
-=
this
.
wordWeight
;
WordSpace
.
totalWordNum
-=
1
;
WordSpace
.
resetGameOverTimer
();
const
groupIdx
=
WordSpace
.
wordGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
groupIdx
>
-
1
)
WordSpace
.
wordGroup
.
splice
(
groupIdx
,
1
);
const
forceIdx
=
WordSpace
.
wordForcedGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
forceIdx
>
-
1
)
WordSpace
.
wordForcedGroup
.
splice
(
forceIdx
,
1
);
//WordSpace.wordPhysicsGroup.remove(this.physicsObj, true, true);
}
}
}
}
js/WordSpace.js
View file @
767e7af6
...
@@ -403,6 +403,8 @@ WordSpace.attack = function(wordText, grade)
...
@@ -403,6 +403,8 @@ WordSpace.attack = function(wordText, grade)
isStrong
:
element
.
isStrong
isStrong
:
element
.
isStrong
}
}
socket
.
emit
(
'
attack
'
,
attackData
);
socket
.
emit
(
'
attack
'
,
attackData
);
element
.
physicsObj
.
destroy
();
element
.
wordObj
.
destroy
();
});
});
//테스트용, 자기 자신에게 공격함
//테스트용, 자기 자신에게 공격함
//WordSpace.generateWord.Attack(WordSpace.gameSceneForTest, wordText, grade, PlayerData, false);
//WordSpace.generateWord.Attack(WordSpace.gameSceneForTest, wordText, grade, PlayerData, false);
...
...
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