built
This commit is contained in:
parent
69a949381f
commit
b7aecbb933
3 changed files with 13 additions and 2 deletions
|
|
@ -957,6 +957,17 @@ function handleInput$1(gameId, playerId, input, ts, onSnap) {
|
|||
changePlayer(gameId, playerId, { name, ts });
|
||||
_playerChange();
|
||||
}
|
||||
else if (type === Protocol.INPUT_EV_MOVE) {
|
||||
const w = input[1];
|
||||
const h = input[2];
|
||||
const player = getPlayer(gameId, playerId);
|
||||
if (player) {
|
||||
const x = player.x - w;
|
||||
const y = player.y - h;
|
||||
changePlayer(gameId, playerId, { ts, x, y });
|
||||
_playerChange();
|
||||
}
|
||||
}
|
||||
else if (type === Protocol.INPUT_EV_MOUSE_DOWN) {
|
||||
const x = input[1];
|
||||
const y = input[2];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue