From 497e51a9ea2fc215b503db32408abf4987d42d23 Mon Sep 17 00:00:00 2001 From: Thilo Behnke Date: Sun, 19 Jun 2022 23:27:42 +0200 Subject: [PATCH] wip - local session inputs --- client/svelte-client/src/App.svelte | 18 +---- client/svelte-client/src/Canvas.svelte | 4 +- client/svelte-client/src/game/engine.ts | 25 +----- client/svelte-client/src/game/session.ts | 96 ++++++++++++++++++++++-- 4 files changed, 93 insertions(+), 50 deletions(-) diff --git a/client/svelte-client/src/App.svelte b/client/svelte-client/src/App.svelte index cf33289..6a28754 100644 --- a/client/svelte-client/src/App.svelte +++ b/client/svelte-client/src/App.svelte @@ -2,7 +2,6 @@ import {FieldWrapper} from "wasm-app"; import Canvas from "./Canvas.svelte"; import Fps from "./Fps.svelte"; - import {keysPressed} from "./game/engine"; import Input from "./Input.svelte"; import {setContext} from "svelte"; import {sessionContext, sessionStore} from "./game/session"; @@ -16,20 +15,6 @@ let debug = false; - function handleKeydown({key}) { - if ($keysPressed.includes(key)) { - return; - } - $keysPressed = [...$keysPressed, key] - } - - function handleKeyup({key}) { - if (!$keysPressed.includes(key)) { - return; - } - $keysPressed = $keysPressed.filter(key => key !== key) - } - function localSession() { sessionStore.createLocalSession(); } @@ -79,13 +64,12 @@
toggleDebug()}> - +
{/if} -