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
cccf35e2
Commit
cccf35e2
authored
Jul 26, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
단어 생성 범위 넓힘, 이제 막타를 친 플레이어에게 아이템 단어가 생성됨
parent
c6744745
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
12 deletions
+19
-12
GameServer.js
GameServer.js
+1
-1
Client.js
js/Client.js
+5
-0
WordObject.js
js/WordObject.js
+7
-3
WordSpace.js
js/WordSpace.js
+6
-8
No files found.
GameServer.js
View file @
cccf35e2
...
@@ -76,7 +76,7 @@ class GameRoom
...
@@ -76,7 +76,7 @@ class GameRoom
{
{
this
.
roomId
=
GameServer
.
getRoomNumber
();
this
.
roomId
=
GameServer
.
getRoomNumber
();
this
.
roomIndex
=
-
1
;
this
.
roomIndex
=
-
1
;
this
.
startCount
=
2
;
this
.
startCount
=
3
;
this
.
maxPlayer
=
100
;
this
.
maxPlayer
=
100
;
this
.
nextRank
=
100
;
this
.
nextRank
=
100
;
...
...
js/Client.js
View file @
cccf35e2
...
@@ -174,6 +174,11 @@ socket.on('defeat', function(msg) // object player
...
@@ -174,6 +174,11 @@ socket.on('defeat', function(msg) // object player
{
{
console
.
log
(
RoomData
.
players
[
msg
.
index
].
nickname
+
'
defeated by
'
+
msg
.
lastAttack
.
attacker
+
'
, with
'
+
msg
.
lastAttack
.
word
);
console
.
log
(
RoomData
.
players
[
msg
.
index
].
nickname
+
'
defeated by
'
+
msg
.
lastAttack
.
attacker
+
'
, with
'
+
msg
.
lastAttack
.
word
);
WordSpace
.
killLogForTest
+=
(
'
\n
'
+
msg
.
lastAttack
.
attacker
+
'
--
'
+
msg
.
lastAttack
.
word
+
'
->
'
+
RoomData
.
players
[
msg
.
index
].
nickname
);
WordSpace
.
killLogForTest
+=
(
'
\n
'
+
msg
.
lastAttack
.
attacker
+
'
--
'
+
msg
.
lastAttack
.
word
+
'
->
'
+
RoomData
.
players
[
msg
.
index
].
nickname
);
if
(
msg
.
lastAttack
.
attackerId
==
RoomData
.
myself
.
id
)
{
var
keys
=
Object
.
keys
(
Enums
.
item
);
WordSpace
.
generateWord
.
Item
(
ScenesData
.
gameScene
,
Enums
.
item
[
keys
[
keys
.
length
*
Math
.
random
()
<<
0
]]);
}
}
}
else
else
{
{
...
...
js/WordObject.js
View file @
cccf35e2
...
@@ -118,9 +118,9 @@ class NormalWord extends WordObject
...
@@ -118,9 +118,9 @@ class NormalWord extends WordObject
case
3
:
WordSpace
.
attackGauge
.
add
(
0.5
);
break
;
case
3
:
WordSpace
.
attackGauge
.
add
(
0.5
);
break
;
default
:
console
.
log
(
'
[ERR] wrong grade of word
'
);
break
;
default
:
console
.
log
(
'
[ERR] wrong grade of word
'
);
break
;
}
}
this
.
wordObj
.
destroy
();
this
.
physicsObj
.
destroy
();
}
}
this
.
wordObj
.
destroy
();
this
.
physicsObj
.
destroy
();
}
}
}
}
...
@@ -161,7 +161,11 @@ class AttackWord extends WordObject
...
@@ -161,7 +161,11 @@ class AttackWord extends WordObject
if
(
this
.
isDark
)
if
(
this
.
isDark
)
{
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
this
.
maskBackground
!=
null
&&
this
.
mask
!=
null
)
this
.
maskBackground
.
setMask
(
this
.
mask
);
if
(
this
.
maskBackground
!=
null
&&
this
.
mask
!=
null
)
{
this
.
maskBackground
.
setMask
(
this
.
mask
);
this
.
maskBackground
.
alpha
=
0.5
;
}
},
4000
);
},
4000
);
}
}
else
this
.
maskBackground
.
setMask
(
this
.
mask
);
else
this
.
maskBackground
.
setMask
(
this
.
mask
);
...
...
js/WordSpace.js
View file @
cccf35e2
...
@@ -44,8 +44,8 @@ WordSpace.getSpawnPoint = function(_lenRate)
...
@@ -44,8 +44,8 @@ WordSpace.getSpawnPoint = function(_lenRate)
{
{
let
lenRate
=
1
;
let
lenRate
=
1
;
if
(
typeof
_lenRate
==
'
number
'
)
lenRate
=
_lenRate
;
if
(
typeof
_lenRate
==
'
number
'
)
lenRate
=
_lenRate
;
let
xLen
=
5
50
*
lenRate
;
let
xLen
=
6
50
*
lenRate
;
let
yLen
=
35
0
*
lenRate
;
let
yLen
=
50
0
*
lenRate
;
const
angle
=
Math
.
random
()
*
Math
.
PI
*
2
;
const
angle
=
Math
.
random
()
*
Math
.
PI
*
2
;
let
_x
=
xLen
*
Math
.
cos
(
angle
)
+
this
.
gravityPoint
.
x
;
let
_x
=
xLen
*
Math
.
cos
(
angle
)
+
this
.
gravityPoint
.
x
;
let
_y
=
yLen
*
Math
.
sin
(
angle
)
+
this
.
gravityPoint
.
y
;
let
_y
=
yLen
*
Math
.
sin
(
angle
)
+
this
.
gravityPoint
.
y
;
...
@@ -250,7 +250,8 @@ WordSpace.generateWord =
...
@@ -250,7 +250,8 @@ WordSpace.generateWord =
if
(
newPlayerData
==
null
)
if
(
newPlayerData
==
null
)
{
{
if
(
WordSpace
.
nameQueue
.
queue
.
length
==
1
)
return
null
;
if
(
WordSpace
.
nameQueue
.
queue
.
length
==
1
)
return
null
;
word
=
new
NameWord
(
WordSpace
.
nameQueue
.
pop
(),
isStrong
);
let
temp
=
WordSpace
.
nameQueue
.
pop
();
word
=
new
NameWord
(
temp
,
isStrong
);
}
}
else
word
=
new
NameWord
(
newPlayerData
,
isStrong
);
else
word
=
new
NameWord
(
newPlayerData
,
isStrong
);
WordSpace
.
pushWord
(
scene
,
word
,
lenRate
);
WordSpace
.
pushWord
(
scene
,
word
,
lenRate
);
...
@@ -511,11 +512,8 @@ WordSpace.nameQueue =
...
@@ -511,11 +512,8 @@ WordSpace.nameQueue =
{
{
let
tempElement
=
WordSpace
.
nameQueue
.
queue
.
shift
();
let
tempElement
=
WordSpace
.
nameQueue
.
queue
.
shift
();
if
(
WordSpace
.
nameQueue
.
queue
.
length
<=
RoomData
.
aliveCount
)
this
.
shuffle
();
if
(
WordSpace
.
nameQueue
.
queue
.
length
<=
RoomData
.
aliveCount
)
this
.
shuffle
();
if
(
this
.
queue
.
length
>
0
)
if
(
!
RoomData
.
players
[
tempElement
].
isAlive
&&
WordSpace
.
nameQueue
.
getCount
(
tempElement
)
<
3
)
return
WordSpace
.
nameQueue
.
pop
();
{
else
return
RoomData
.
players
[
tempElement
];
if
(
!
RoomData
.
players
[
tempElement
].
isAlive
&&
WordSpace
.
nameQueue
.
getCount
(
tempElement
)
<
3
)
WordSpace
.
nameQueue
.
pop
();
else
return
RoomData
.
players
[
tempElement
];
}
},
},
getCount
:
function
(
player
)
getCount
:
function
(
player
)
{
{
...
...
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