summaryrefslogtreecommitdiff
path: root/client/src/net
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-06-29 21:52:26 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-06-29 21:52:26 -0400
commit484409b64d0a1dadcf35fa664ecf3dcd4808a83a (patch)
treeba9bd26d0914f369d3eafa8a04b12bec69a70fcc /client/src/net
parentwhen players die, they should acutally fucking die (diff)
downloadtuxman-484409b64d0a1dadcf35fa664ecf3dcd4808a83a.tar.gz
tuxman-484409b64d0a1dadcf35fa664ecf3dcd4808a83a.tar.bz2
tuxman-484409b64d0a1dadcf35fa664ecf3dcd4808a83a.zip
custom map overrides
Diffstat (limited to 'client/src/net')
-rw-r--r--client/src/net/game.ts2
-rw-r--r--client/src/net/input.ts7
2 files changed, 8 insertions, 1 deletions
diff --git a/client/src/net/game.ts b/client/src/net/game.ts
index 88a36b1..93a5e6b 100644
--- a/client/src/net/game.ts
+++ b/client/src/net/game.ts
@@ -114,7 +114,7 @@ export class Game {
onLoad: (startFrame: Frame) => boolean,
onFrame: (data: Frame, frame: number) => void,
onLogic: (pastData: GameState, input: Input, frame: number) => GameState,
- data: PlayerInput = { start: false, key: Key.NOTHING }
+ data: PlayerInput = { start: false, key: Key.NOTHING, maps: {}}
): void {
const fps = 60;
diff --git a/client/src/net/input.ts b/client/src/net/input.ts
index 75be3e6..9b45e59 100644
--- a/client/src/net/input.ts
+++ b/client/src/net/input.ts
@@ -1,4 +1,5 @@
import { Key, KeyMap, PlayerInput } from "../types.js"
+import { maps as definedMaps } from '../main.js'
let pressed = {}
@@ -62,9 +63,15 @@ export const startInputListener = (keymap: KeyMap): () => PlayerInput => {
let s = start;
start = false;
+ let maps = {}
+ if (s) {
+ maps = definedMaps
+ }
+
return {
key,
start: s,
+ maps
}
}
}