Compare commits

...

2 Commits

Author SHA1 Message Date
Axel Meyer
b79dd8e472 Bump dep on lib-core.maps to 0.2.0
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 16:14:20 +02:00
Axel Meyer
7fac933066 Upgrade spine-prototype demo to multi-layer schema-v2 map
Surface + wall layers with entity slot between them. Uses
maps.draw_map_pre_entities and maps.draw_map_post_entities so character
sprites render between surface and wall layers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 16:02:55 +02:00
3 changed files with 49 additions and 23 deletions

View File

@@ -126,7 +126,7 @@ end
function render(ctx)
engine.render.clear_color(engine.render.rgb(20, 20, 30))
camera.begin()
r_lib.draw_map()
maps.draw_map_pre_entities()
-- draw sign on top of map
engine.render.draw_rect(sign.x - 6, sign.y - 6, 12, 12,
engine.render.rgb(SIGN_R, SIGN_G, SIGN_B))
@@ -142,6 +142,7 @@ function render(ctx)
engine.render.rgb(PLAYER_R, PLAYER_G, PLAYER_B))
-- P.3.6: highlights over selected entities (world-space)
selection.render_highlights()
maps.draw_map_post_entities()
camera.finish()
-- P.3.6: drag-box overlay (screen-space, after camera.finish)
selection.render_drag_box()

View File

@@ -6,7 +6,7 @@
"ci_frames": 30,
"entry_point": "init.lua",
"deps": [
{"id":"lib-core.maps","version":"0.1.2"},
{"id":"lib-core.maps","version":"0.2.0"},
{"id":"lib-core.render","version":"0.1.0"},
{"id":"lib-core.camera","version":"0.3.0"},
{"id":"lib-core.selection","version":"0.1.0"},
@@ -15,4 +15,4 @@
{"id":"lib-core.interaction","version":"0.1.0"},
{"id":"lib-core.command","version":"0.1.0"}
]
}
}

View File

@@ -1,23 +1,48 @@
{
"schema_version": 2,
"id": "demo",
"tilemap": "demo_tilemap",
"size": {"w": 16, "h": 16},
"tiles": [
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
]
"size": { "w": 16, "h": 16 },
"atlases": ["demo_tilemap"],
"layers": {
"surface": {
"tiles": [
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
]
},
"wall": {
"tiles": [
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
]
}
}
}