summaryrefslogtreecommitdiff
path: root/client/src/editor.ts
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-06-25 18:19:26 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-06-25 18:19:26 -0400
commit0281233cbdc76e065a812780de0325fcfbd4e660 (patch)
tree51b8049b98de607fbb84ded183787a3958fc93f3 /client/src/editor.ts
parentexport and load maps (diff)
downloadtuxman-0281233cbdc76e065a812780de0325fcfbd4e660.tar.gz
tuxman-0281233cbdc76e065a812780de0325fcfbd4e660.tar.bz2
tuxman-0281233cbdc76e065a812780de0325fcfbd4e660.zip
ghost
Diffstat (limited to 'client/src/editor.ts')
-rw-r--r--client/src/editor.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/client/src/editor.ts b/client/src/editor.ts
index 1abaad4..0be5c68 100644
--- a/client/src/editor.ts
+++ b/client/src/editor.ts
@@ -1,3 +1,4 @@
+import { InitialState } from "./logic/logic.js"
import { genMap, compressMap, decompressMap } from "./map.js"
import { startGraphicsUpdater } from "./renderer.js"
import { GameState, Vec2, Tile } from "./types.js"
@@ -128,13 +129,9 @@ const runMapEditor = (width: number, height: number) => {
let map = genMap(width, height, data, Tile.EMPTY)
- let state: GameState = {
- started: true,
- input: {},
- players: {},
- items: {},
- mapId: 0
- }
+ let state: GameState = structuredClone(InitialState);
+ state.mapId = 0;
+ state.started = true;
let frame = 0
const updateGraphics = startGraphicsUpdater()