summaryrefslogtreecommitdiff
path: root/client/src/editor.ts
diff options
context:
space:
mode:
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()