This commit is contained in:
Zutatensuppe 2021-05-31 23:09:03 +02:00
parent 69a949381f
commit b7aecbb933
3 changed files with 13 additions and 2 deletions

View file

@ -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];