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
efb86266
Commit
efb86266
authored
Jul 13, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 강호패를 획득할 경우 호패가 아래에 쌓임
parent
767e7af6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
Client.js
js/Client.js
+3
-2
WordObject.js
js/WordObject.js
+6
-12
No files found.
js/Client.js
View file @
efb86266
...
@@ -53,8 +53,9 @@ socket.on('defeat', function(msg) // object player
...
@@ -53,8 +53,9 @@ socket.on('defeat', function(msg) // object player
socket
.
on
(
'
attackSucceed
'
,
function
(
msg
)
socket
.
on
(
'
attackSucceed
'
,
function
(
msg
)
{
{
let
tempWord
=
new
NameWord
(
msg
.
victim
,
true
);
WordSpace
.
nameGroup
.
push
(
new
NameWord
(
msg
.
victim
,
true
));
tempWord
.
instantiate
(
WordSpace
.
gameSceneForTest
);
tempWord
.
destroy
();
});
});
// out game
// out game
...
...
js/WordObject.js
View file @
efb86266
...
@@ -66,12 +66,15 @@ class WordObject
...
@@ -66,12 +66,15 @@ class WordObject
WordSpace
.
totalWeight
-=
this
.
wordWeight
;
WordSpace
.
totalWeight
-=
this
.
wordWeight
;
WordSpace
.
totalWordNum
-=
1
;
WordSpace
.
totalWordNum
-=
1
;
WordSpace
.
resetGameOverTimer
();
WordSpace
.
resetGameOverTimer
();
this
.
wordObj
.
destroy
();
const
groupIdx
=
WordSpace
.
wordGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
const
groupIdx
=
WordSpace
.
wordGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
groupIdx
>
-
1
)
WordSpace
.
wordGroup
.
splice
(
groupIdx
,
1
);
if
(
groupIdx
>
-
1
)
WordSpace
.
wordGroup
.
splice
(
groupIdx
,
1
);
const
forceIdx
=
WordSpace
.
wordForcedGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
const
forceIdx
=
WordSpace
.
wordForcedGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
forceIdx
>
-
1
)
WordSpace
.
wordForcedGroup
.
splice
(
forceIdx
,
1
);
if
(
forceIdx
>
-
1
)
WordSpace
.
wordForcedGroup
.
splice
(
forceIdx
,
1
);
WordSpace
.
wordPhysicsGroup
.
remove
(
this
.
physicsObj
,
true
,
true
);
if
(
!
this
.
isNameWord
)
{
this
.
wordObj
.
destroy
();
WordSpace
.
wordPhysicsGroup
.
remove
(
this
.
physicsObj
,
true
,
true
);
}
}
}
...
@@ -187,15 +190,6 @@ class NameWord extends WordObject
...
@@ -187,15 +190,6 @@ class NameWord extends WordObject
this
.
physicsObj
.
setVelocity
(
0
,
0
);
this
.
physicsObj
.
setVelocity
(
0
,
0
);
this
.
physicsObj
.
setPosition
(
100
+
WordSpace
.
nameGroup
.
length
*
50
,
650
).
setDepth
(
2
);
this
.
physicsObj
.
setPosition
(
100
+
WordSpace
.
nameGroup
.
length
*
50
,
650
).
setDepth
(
2
);
this
.
wordObj
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
).
setDepth
(
2
);
this
.
wordObj
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
).
setDepth
(
2
);
super
.
destroy
();
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);
}
}
}
}
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