Add v0.2.0 test assertions, multi-layer fixture, second atlas

Migrates the test-lib content authored alongside lib-core.maps v0.2.0
into its canonical role=test location. Covers packed-u32 GID encode/
decode round-trip, v1 to v2 schema upgrade, schema-v2 validation,
multi-layer load, multi-atlas resolution, per-layer tile lookup with
tile_at backwards-compat, gameplay queries (is_walkable, blocks_walk,
blocks_sight), layer iteration around the entity slot, and v1 JSON
auto-migration on load. 367 assertions total when run via the engine
test-libs harness.

New fixtures: maps/demo_v2.map.json (4x4 multi-layer with roof) and
assets/tiles/walls_tilemap.tilemap.json (second atlas with wall tiles).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Axel Meyer
2026-05-21 17:54:08 +02:00
parent 705cae199e
commit c3e9eda702
3 changed files with 259 additions and 4 deletions

38
maps/demo_v2.map.json Normal file
View File

@@ -0,0 +1,38 @@
{
"schema_version": 2,
"id": "demo_v2",
"size": { "w": 4, "h": 4 },
"atlases": ["demo_tilemap", "walls_tilemap"],
"layers": {
"surface": {
"tiles": [
32, 32, 32, 32,
32, 16, 16, 32,
32, 16, 16, 32,
32, 32, 32, 32
]
},
"wall": {
"tiles": [
16777232, 16777232, 16777232, 16777232,
16777232, 0, 0, 16777232,
16777232, 0, 0, 16777232,
16777232, 16777232, 16777232, 16777232
]
},
"topsurface": {
"tiles": [
0, 0, 0, 0,
0, 0, 16, 0,
0, 0, 0, 0,
0, 0, 0, 0
]
}
},
"roof": [
0, 0, 0, 0,
0, 1, 1, 0,
0, 1, 1, 0,
0, 0, 0, 0
]
}