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
025a55ca
Commit
025a55ca
authored
Aug 09, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
막타를 친 플레이어에게 보따리가 생성됨
parent
e41ce1c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
Client.js
js/Client.js
+28
-2
server.js
server.js
+1
-1
No files found.
js/Client.js
View file @
025a55ca
...
...
@@ -169,9 +169,9 @@ socket.on('attacked', function(msg) // object attackData
WordSpace
.
attackedEvents
.
push
(
attackedEvent
);
//console.log(timeout);
});
socket
.
on
(
'
defeat
'
,
function
(
msg
)
// object player
{
//수정해야 함 코드 너무 복잡함
let
playerImage
=
RoomData
.
findPlayer
(
msg
.
id
).
playerImage
;
let
position
=
RoomData
.
findPlayer
(
msg
.
id
).
position
;
let
nicknameText
=
RoomData
.
findPlayer
(
msg
.
id
).
nicknameText
;
...
...
@@ -194,7 +194,33 @@ socket.on('defeat', function(msg) // object player
{
var
keys
=
Object
.
keys
(
Enums
.
item
);
WordSpace
.
generateWord
.
Item
(
ScenesData
.
gameScene
,
Enums
.
item
[
keys
[
keys
.
length
*
Math
.
random
()
<<
0
]]);
let
itemBag
=
ScenesData
.
gameScene
.
add
.
sprite
(
RoomData
.
myself
.
position
.
x
,
RoomData
.
myself
.
position
.
y
,
'
itemBag
'
).
setScale
(
1
).
setDepth
(
5
);
let
itemBag
=
ScenesData
.
gameScene
.
add
.
sprite
(
RoomData
.
myself
.
position
.
x
,
RoomData
.
myself
.
position
.
y
,
'
itemBag
'
).
setScale
(
0
).
setDepth
(
5
);
ScenesData
.
gameScene
.
tweens
.
add
({
targets
:
itemBag
,
scaleX
:
1
,
scaleY
:
1
,
ease
:
'
Linear
'
,
// 'Cubic', 'Elastic', 'Bounce', 'Back'
duration
:
500
,
repeat
:
0
,
// -1: infinity
yoyo
:
false
,
onComplete
:
function
()
{
setTimeout
(
function
()
{
ScenesData
.
gameScene
.
tweens
.
add
({
targets
:
itemBag
,
scaleX
:
0
,
scaleY
:
0
,
ease
:
'
Linear
'
,
// 'Cubic', 'Elastic', 'Bounce', 'Back'
duration
:
500
,
repeat
:
0
,
// -1: infinity
yoyo
:
false
});
},
1500
);
},
onCompleteScope
:
ScenesData
.
gameScene
});
setTimeout
(
function
()
{
itemBag
.
destroy
();
},
3000
);
...
...
server.js
View file @
025a55ca
...
...
@@ -13,7 +13,7 @@ app.get('/', function(req, res) {
});
// http 기본 포트(80)에 서버 열기
server
.
listen
(
80
,
function
()
{
server
.
listen
(
80
80
,
function
()
{
console
.
log
(
'
[SERVER] Listening on port
'
+
server
.
address
().
port
);
});
...
...
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