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
61ee6c98
Commit
61ee6c98
authored
Aug 13, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wordspace'
parents
7126dc88
025a55ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
Client.js
js/Client.js
+28
-1
server.js
server.js
+1
-1
No files found.
js/Client.js
View file @
61ee6c98
...
...
@@ -178,6 +178,7 @@ 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
;
...
...
@@ -201,7 +202,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 @
61ee6c98
...
...
@@ -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
);
GameServer
.
serverNumber
=
Math
.
floor
(
Math
.
random
()
*
1000
+
1
);
console
.
log
(
'
[SERVER] server number is ${GameServer.serverNumber}
'
);
...
...
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