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
a9949132
Commit
a9949132
authored
Jul 20, 2019
by
18손재민
Committed by
18류지석
Jul 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
다른 플레이어의 닉네임도 같이 표시함
parent
0cca4b1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
Background.js
js/Background.js
+3
-1
WordSpace.js
js/WordSpace.js
+2
-8
No files found.
js/Background.js
View file @
a9949132
...
...
@@ -22,13 +22,15 @@ BackGround.loadImage = function(scene)
BackGround
.
drawCharacter
=
function
(
scene
)
{
BackGround
.
myCharacter
=
scene
.
add
.
sprite
(
game
.
config
.
width
/
2
,
game
.
config
.
height
*
41
/
48
,
'
pyeongminWrite
'
).
setScale
(
0.45
).
setDepth
(
2
);
BackGround
.
characterPos
=
Phaser
.
Utils
.
Array
.
Shuffle
(
BackGround
.
characterPos
);
BackGround
.
characterPos
=
BackGround
.
characterPos
.
sort
(
function
(){
return
0.5
-
Math
.
random
()}
);
RoomData
.
players
.
forEach
(
function
(
element
){
if
(
element
.
id
!=
RoomData
.
myself
.
id
)
{
element
.
position
=
BackGround
.
characterPos
.
pop
();
BackGround
.
otherCharacters
.
push
(
scene
.
add
.
sprite
(
element
.
position
.
x
,
element
.
position
.
y
,
'
pyeongminWrite
'
).
setScale
(
0.45
).
setDepth
(
1
));
BackGround
.
otherCharacters
[
BackGround
.
otherCharacters
.
length
-
1
].
flipX
=
element
.
position
.
x
<
game
.
config
.
width
/
2
?
true
:
false
;
BackGround
.
otherCharacters
[
BackGround
.
otherCharacters
.
length
-
1
].
nicknameText
=
scene
.
add
.
text
(
element
.
position
.
x
,
element
.
position
.
y
-
90
,
element
.
nickname
)
.
setOrigin
(
0.5
,
0.5
).
setColor
(
'
#000000
'
).
setPadding
(
0.5
,
0.5
,
0.5
,
0.5
).
setDepth
(
1
);
}
});
}
...
...
js/WordSpace.js
View file @
a9949132
...
...
@@ -425,17 +425,11 @@ WordSpace.nameQueue =
queue
:
[],
shuffle
:
function
()
{
let
temp
Idx
,
tempElement
,
tempLength
,
temp
Queue
=
[];
let
tempQueue
=
[];
RoomData
.
players
.
forEach
(
function
(
element
){
tempQueue
.
push
(
element
.
index
)
})
for
(
tempLength
=
tempQueue
.
length
;
tempLength
;
tempLength
-=
1
)
{
tempIdx
=
Math
.
floor
(
Math
.
random
()
*
tempLength
);
tempElement
=
tempQueue
[
tempLength
-
1
];
tempQueue
[
tempLength
-
1
]
=
tempQueue
[
tempIdx
];
tempQueue
[
tempIdx
]
=
tempElement
;
}
tempQueue
.
sort
(
function
(){
return
0.5
-
Math
.
random
()});
tempQueue
.
forEach
(
function
(
element
)
{
if
(
RoomData
.
players
[
element
].
id
!=
PlayerData
.
id
&&
RoomData
.
players
[
element
].
isAlive
)
...
...
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