From 113c6d105a0b06603388e5e0ded90ed169ae0c50 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 17 Jun 2023 01:18:16 -0400 Subject: map editor --- client/src/map.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'client/src/map.ts') diff --git a/client/src/map.ts b/client/src/map.ts index e6fab9d..d26c467 100644 --- a/client/src/map.ts +++ b/client/src/map.ts @@ -126,6 +126,24 @@ export const genItems = (map: Map): Items => { let mapData: Maps = {} let id: number = 0 +export const genMap = ( + width: number, + height: number, + data: number[], + mapId: number, +): Map => { + + mapData[mapId] = { + data: structuredClone(data), + walls: genWalls(width, height, data), + width, + height, + id: mapId + } + + return mapData[mapId] +} + export const loadMap = ( width: number, height: number, -- cgit v1.2.3-freya