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
406cf127
Commit
406cf127
authored
Jul 24, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 모든 플레이어들에게 종이뭉치가 날라가는 것이 보임
parent
5efa8948
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
Client.js
js/Client.js
+5
-7
server.js
server.js
+1
-1
No files found.
js/Client.js
View file @
406cf127
...
@@ -140,10 +140,13 @@ socket.on('attackMode', function(msg) // number playerId
...
@@ -140,10 +140,13 @@ socket.on('attackMode', function(msg) // number playerId
console
.
log
(
msg
+
'
is on attack Mode
'
);
console
.
log
(
msg
+
'
is on attack Mode
'
);
// msg의 id를 가진 사람이 attack Mode이다.
// msg의 id를 가진 사람이 attack Mode이다.
});
});
socket
.
on
(
'
attack
'
,
function
(
msg
)
// {number attackerId, number targetId}
socket
.
on
(
'
someoneAttacked
'
,
function
(
msg
)
// {number attackerId, number targetId}
{
{
// 이때 위의 attack Mode인 사람(msg.attackerId)을 해제해주자.
// 이때 위의 attack Mode인 사람(msg.attackerId)을 해제해주자.
console
.
log
(
msg
.
attackerId
+
'
attack to
'
+
msg
.
targetId
);
console
.
log
(
msg
.
attackerId
+
'
attacked
'
+
msg
.
targetId
);
let
attackerPos
=
RoomData
.
players
.
find
(
function
(
element
){
return
element
.
id
==
msg
.
attackerId
;
});
let
victimPos
=
RoomData
.
players
.
find
(
function
(
element
){
return
element
.
id
==
msg
.
victimId
;
});
WordSpace
.
makeAttackPaper
(
ScenesData
.
gameScene
,
attackerPos
.
position
,
victimPos
.
position
);
});
});
socket
.
on
(
'
attacked
'
,
function
(
msg
)
// object attackData
socket
.
on
(
'
attacked
'
,
function
(
msg
)
// object attackData
{
{
...
@@ -161,11 +164,6 @@ socket.on('attacked', function(msg) // object attackData
...
@@ -161,11 +164,6 @@ socket.on('attacked', function(msg) // object attackData
attackedEvent
.
resetCycle
(
ScenesData
.
gameScene
,
4000
,
0
,
false
);
attackedEvent
.
resetCycle
(
ScenesData
.
gameScene
,
4000
,
0
,
false
);
WordSpace
.
attackedEvents
.
push
(
attackedEvent
);
WordSpace
.
attackedEvents
.
push
(
attackedEvent
);
console
.
log
(
msg
.
attacker
);
console
.
log
(
msg
.
victim
);
let
victimPos
=
RoomData
.
players
.
find
(
function
(
element
){
return
element
.
id
==
msg
.
victim
.
id
;
});
let
attackerPos
=
RoomData
.
players
.
find
(
function
(
element
){
return
element
.
id
==
msg
.
attacker
.
id
;
});
WordSpace
.
makeAttackPaper
(
ScenesData
.
gameScene
,
attackerPos
.
position
,
victimPos
.
position
);
//console.log(timeout);
//console.log(timeout);
});
});
socket
.
on
(
'
defeat
'
,
function
(
msg
)
// object player
socket
.
on
(
'
defeat
'
,
function
(
msg
)
// object player
...
...
server.js
View file @
406cf127
...
@@ -95,7 +95,7 @@ io.on('connection', function(socket)
...
@@ -95,7 +95,7 @@ io.on('connection', function(socket)
socket
.
on
(
'
attack
'
,
function
(
msg
)
socket
.
on
(
'
attack
'
,
function
(
msg
)
{
{
socket
.
playerData
.
currentRoom
.
announceToTarget
(
msg
.
victim
.
id
,
'
attacked
'
,
msg
);
socket
.
playerData
.
currentRoom
.
announceToTarget
(
msg
.
victim
.
id
,
'
attacked
'
,
msg
);
socket
.
playerData
.
currentRoom
.
announceToRoom
(
'
attack
'
,
{
attackerId
:
msg
.
attacker
.
id
,
target
Id
:
msg
.
victim
.
id
});
socket
.
playerData
.
currentRoom
.
announceToRoom
(
'
someoneAttacked
'
,
{
attackerId
:
msg
.
attacker
.
id
,
victim
Id
:
msg
.
victim
.
id
});
//console.log('attack ' + msg.target + ' by ' + msg.attacker.id + ' with ' + msg.text);
//console.log('attack ' + msg.target + ' by ' + msg.attacker.id + ' with ' + msg.text);
setTimeout
(
function
()
setTimeout
(
function
()
{
{
...
...
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