Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
강동현
2021-06-10 05:15:28 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
08180ab3df5229deb0fc64fa832a2352665d6072
08180ab3
1 parent
74bead5c
캔버스 좌표 범위 변경
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
server/game/Game.ts
server/test/moveBrush.test.ts
server/game/Game.ts
View file @
08180ab
...
...
@@ -103,8 +103,8 @@ export class Game {
return
{
ok
:
false
};
}
this
.
brush
.
x
=
Math
.
max
(
Math
.
min
(
message
.
x
,
1
),
0
);
this
.
brush
.
y
=
Math
.
max
(
Math
.
min
(
message
.
y
,
1
),
0
);
this
.
brush
.
x
=
Math
.
max
(
Math
.
min
(
message
.
x
,
640
),
0
);
this
.
brush
.
y
=
Math
.
max
(
Math
.
min
(
message
.
y
,
480
),
0
);
this
.
room
.
broadcast
(
"moveBrush"
,
...
...
server/test/moveBrush.test.ts
View file @
08180ab
...
...
@@ -12,10 +12,10 @@ describe("라운드 브러시 이동", () => {
it
(
"영역을 벗어난 좌표는 Clamp 처리됩니다"
,
()
=>
{
const
{
drawerSocket
,
guesserSockets
}
=
prepareGame
(
2
);
drawerSocket
.
testOk
(
"moveBrush"
,
{
x
:
-
1
,
y
:
2
});
drawerSocket
.
testOk
(
"moveBrush"
,
{
x
:
-
1
,
y
:
1000
});
expect
(
guesserSockets
[
0
].
socket
.
received
(
"moveBrush"
)).
deep
.
eq
({
x
:
0
,
y
:
1
,
y
:
480
,
});
});
it
(
"drawer가 아닌 다른 사람들은 브러시를 이동할 수 없습니다"
,
()
=>
{
...
...
Please
register
or
login
to post a comment