zoom to mouse even when using q/e
This commit is contained in:
parent
870f827e49
commit
69a949381f
3 changed files with 54 additions and 16 deletions
|
|
@ -625,6 +625,16 @@ function handleInput(
|
|||
const name = `${input[1]}`.substr(0, 16)
|
||||
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