commit 9d41ba8890d45e2afe44370df508d362dcf0fba6 Author: Calic Date: Sun May 24 01:04:44 2026 +0200 Scaffold sporel-module-map-editor package Empty launchable module with deps on lib-core.maps 0.4.0, render, camera, input, and the fa_terrain_v1 asset alias. Renders the default 4x4 empty work-map; interactive editing wired in subsequent commits. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b69b126 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# sporel-module-map-editor + +Interactive map editor module for v2 Sporel maps. Click-to-paint, vertical layer-chip overlay, collapsible atlas+tile picker. + +## Status + +`v0.1.0` — initial POC. See `docs/superpowers/specs/2026-05-23-sporel-module-map-editor-design.md` in `sporel-meta` for the full spec. + +## Run + +```bash +bash scripts/run-map-editor.sh [target_map.json] +``` + +(Detailed hotkey reference and UI walkthrough added in a later commit.) diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..6f00cc1 --- /dev/null +++ b/init.lua @@ -0,0 +1,18 @@ +-- sporel-module-map-editor v0.1.0 +-- Interactive map editor; full wiring lands in subsequent commits. + +local maps = require("lib-core.maps") + +local work_map_id = maps.load("maps/work.map.json") +maps.set_current(work_map_id) +maps.load_textures(engine.module.asset_aliases()) + +engine.print("map-editor: scaffold loaded, map_id=" .. work_map_id) + +function update(ctx, dt) + -- TODO: wired in later commits +end + +function draw() + maps.draw_map() +end diff --git a/manifest.module b/manifest.module new file mode 100644 index 0000000..a38c4c1 --- /dev/null +++ b/manifest.module @@ -0,0 +1,18 @@ +{ + "id": "sporel-module-map-editor", + "version": "0.1.0", + "kind": "module", + "api": "^0.1", + "ci_frames": 30, + "entry_point": "init.lua", + "asset_aliases": { + "fa_terrain_v1": "lib-asset.prototype-fa-starter" + }, + "deps": [ + {"id":"lib-core.maps","version":"0.4.0"}, + {"id":"lib-core.render","version":"0.1.0"}, + {"id":"lib-core.camera","version":"0.3.0"}, + {"id":"lib-core.input","version":"0.4.0"}, + {"id":"lib-asset.prototype-fa-starter","version":"0.2.0"} + ] +} diff --git a/maps/work.map.json b/maps/work.map.json new file mode 100644 index 0000000..5a9077f --- /dev/null +++ b/maps/work.map.json @@ -0,0 +1,11 @@ +{ + "schema_version": 2, + "id": "work", + "size": { "w": 4, "h": 4 }, + "atlases": ["fa_terrain_v1"], + "layers": { + "surface": { + "tiles": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + } + } +}