diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-17 13:32:18 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-17 13:32:18 +0200 |
commit | 5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36 (patch) | |
tree | cab52ea116eb19fc2a0a3b2158b2086b6db790a9 /test-client/main.ts | |
parent | 3f23989c2829a4a99349d4670511d71c0f4af8e1 (diff) | |
download | hurrycurry-5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36.tar hurrycurry-5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36.tar.bz2 hurrycurry-5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36.tar.zst |
active start / stop
Diffstat (limited to 'test-client/main.ts')
-rw-r--r-- | test-client/main.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test-client/main.ts b/test-client/main.ts index f31176cd..3e04dc05 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -84,7 +84,7 @@ const keys_down = new Set(); const HANDLED_KEYS = ["KeyW", "KeyA", "KeyS", "KeyD", "Space"] function keyboard(ev: KeyboardEvent, down: boolean) { if (HANDLED_KEYS.includes(ev.code)) ev.preventDefault() - if (ev.code == "Space" && down) interact() + if (ev.code == "Space") interact(down) if (down) keys_down.add(ev.code) else keys_down.delete(ev.code) } @@ -98,9 +98,9 @@ function get_interact_target(): V2 | undefined { } } -function interact() { +function interact(edge: boolean) { const { x, y } = get_interact_target()!; - send({ interact: { pos: [x, y] } }) + send({ interact: { pos: [x, y], edge } }) } function tick_update() { |