feat(engine): #90 atlas-aware Sprite component, #91 become from listeners, 0.3.x ergonomics batch
All checks were successful
bootstrap / cfree-fixpoint (push) Successful in 32s
ci / build-and-test (push) Successful in 2m49s
commit-lint / conventional-commits (push) Successful in 5s
docs / build-and-deploy (push) Successful in 30s

Closes the two open issues and lands the pending unreleased batch:

- #90: `Sprite { atlas: 1 }` routes esys_sprite through atlas_draw_ex
  (scale/flip/tint), so cell / cell_span / strip ids of any size draw
  through the engine sprite-render system. examples/library/sprite_atlas
  is the pixel-readback regression.
- #91: `become` from an @On(Event) listener / global handler / plain
  function no longer segfaults the compiler; it emits @L_scene_leave()
  (a dispatch on the live scene id) so the leaving scene's on-exit runs.
  UI_* handles are readable from any code (widget table built on first
  use). examples/library/scene_menus covers it.
- fix: a windowed `ludicc -o` build that reaches the audio runtime only
  through the atlas/Assets preload import now links audio.ll +
  AVFoundation (the audio backend link was gated on a game-level
  Audio.* call, so any windowed game declaring Sprite failed to link).
- the hand-written "Unreleased" CHANGELOG section is converted to
  changesets under changes/ so `x release` generates it.
- plus the batch: engine-driven retained UI + UiClicked event, Overlay
  phase, TileSkin tilemap-render system, Key.* constants, Font/Ui/File
  namespaces, Sprite.strip, prefabs, managers, countdown fields,
  enum-typed machines, layer @Queries, ludic.prefs / ludic.dungeon
  packages, Ai.seek pathing, Solids.solid2, cursor confine (mode 3)
  fix, shooter centre-aim fix, reserved-word function diagnostic.

Verified: x test (124/124), x test-tools, check-impl, check-vocabulary,
check-docs, docs-gen + docs-check, bootstrap-cfree (seed is a fixpoint).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-04 01:36:08 +03:00
parent e9c2c51bc3
commit ad548840c7
139 changed files with 58981 additions and 43671 deletions

View file

@ -0,0 +1,20 @@
---
id: map-border
name: Map.border
category: map
kind: namespace-method
tokens: Map.border
sig: Map.border(glyph: g)
tip: The outermost ring of cells.
order: 14
ns: Map
member: border
---
Writes <code>glyph</code> along the map's edge — the arena wall around a generated room.
```ludic
# doc-check: skip — illustrative
Map.fill(glyph: '.')
Map.border(glyph: '#')
```

View file

@ -0,0 +1,20 @@
---
id: map-fill
name: Map.fill
category: map
kind: namespace-method
tokens: Map.fill
sig: Map.fill(glyph: g)
tip: Every cell becomes the glyph.
order: 12
ns: Map
member: fill
---
Fills the whole map with one glyph — the first stroke of a generated room.
```ludic
# doc-check: skip — illustrative
Map.size(20, 15)
Map.fill(glyph: '.')
```

View file

@ -0,0 +1,19 @@
---
id: map-get
name: Map.get
category: map
kind: namespace-method
tokens: Map.get
sig: Map.get(x: tx, y: ty) -> int
tip: The glyph at a cell ('#' outside the map).
order: 10
ns: Map
member: get
---
Reads one cell of the tilemap by tile coordinates; outside the map it answers <code>'#'</code>, so the edge of the world reads as wall.
```ludic
# doc-check: skip — illustrative
if Map.get(x: 3, y: 4) == '.' { … }
```

View file

@ -0,0 +1,19 @@
---
id: map-height
name: Map.height
category: map
kind: namespace-method
tokens: Map.height
sig: Map.height() -> int
tip: The map's height in cells.
order: 19
ns: Map
member: height
---
The height set by <code>Map.size</code>.
```ludic
# doc-check: skip — illustrative
for y in 0 .. Map.height() { … }
```

View file

@ -0,0 +1,19 @@
---
id: map-is_solid
name: Map.is_solid
category: map
kind: namespace-method
tokens: Map.is_solid
sig: Map.is_solid(x: tx, y: ty) -> bool
tip: Is a cell solid, per the Solids config?
order: 16
ns: Map
member: is_solid
---
True when the cell holds one of the solid glyphs the <code>Solids</code> configuration names (<code>wall</code>, <code>solid2</code>), or lies outside the map. With no <code>Solids</code> entity nothing is solid. The move system and the projectiles use the same answer.
```ludic
# doc-check: skip — illustrative
if Map.is_solid(x: tile.x, y: tile.y) { continue }
```

View file

@ -0,0 +1,19 @@
---
id: map-is_solid_at
name: Map.is_solid_at
category: map
kind: namespace-method
tokens: Map.is_solid_at
sig: Map.is_solid_at(x: px, y: py) -> bool
tip: Is the cell under a pixel position solid?
order: 17
ns: Map
member: is_solid_at
---
<code>Map.is_solid</code> for a pixel position, using the tile size from the <code>Solids</code> config.
```ludic
# doc-check: skip — illustrative
if not Map.is_solid_at(x: pushed.x, y: pushed.y) { Position.x = pushed.x }
```

View file

@ -0,0 +1,20 @@
---
id: map-random_cell
name: Map.random_cell
category: map
kind: namespace-method
tokens: Map.random_cell
sig: Map.random_cell(glyph: g) -> IVec2
tip: A random cell holding the glyph (seeded RNG).
order: 15
ns: Map
member: random_cell
---
Picks a random cell whose glyph matches: random tries first, then a sweep, so a map with any such cell always yields one; <code>(-1, -1)</code> when none exists. Deterministic, from the seeded RNG.
```ludic
# doc-check: skip — illustrative
let tile = Map.random_cell(glyph: '.')
Spawn.enemy(kind, IVec2.scale(tile, 16))
```

View file

@ -0,0 +1,19 @@
---
id: map-random_cell_far
name: Map.random_cell_far
category: map
kind: namespace-method
tokens: Map.random_cell_far
sig: Map.random_cell_far(glyph:, from:, min_tiles:) -> IVec2
tip: A random cell with the glyph, at least a distance from a point.
order: 20
ns: Map
member: random_cell_far
---
Like <code>Map.random_cell</code>, but at least <code>min_tiles</code> from <code>from</code> when it can find one — a spawn point away from the hero.
```ludic
# doc-check: skip — illustrative
let tile = Map.random_cell_far(glyph: '.', from: hero_tile, min_tiles: 6)
```

View file

@ -0,0 +1,19 @@
---
id: map-rect
name: Map.rect
category: map
kind: namespace-method
tokens: Map.rect
sig: Map.rect(x: tx, y: ty, width: w, height: h, glyph: g)
tip: Fill a rectangle of cells.
order: 13
ns: Map
member: rect
---
Writes <code>glyph</code> into every cell of the rectangle; cells outside the map are skipped. A wall slab, a carved corridor, a cleared lane.
```ludic
# doc-check: skip — illustrative
Map.rect(x: 9, y: 1, width: 2, height: 13, glyph: '.') # a lane the cover never blocks
```

View file

@ -0,0 +1,19 @@
---
id: map-set
name: Map.set
category: map
kind: namespace-method
tokens: Map.set
sig: Map.set(x: tx, y: ty, glyph: g)
tip: Write one cell in place.
order: 11
ns: Map
member: set
---
Writes one cell of the tilemap. A game edits the engine's grid directly — carving a door, placing a pillar — instead of keeping its own copy and re-stamping rows.
```ludic
# doc-check: skip — illustrative
Map.set(x: 9, y: 0, glyph: '.') # open the north door
```

View file

@ -0,0 +1,19 @@
---
id: map-to_tile
name: Map.to_tile
category: map
kind: namespace-method
tokens: Map.to_tile
sig: Map.to_tile(pixel: IVec2) -> IVec2
tip: The tile under a pixel position.
order: 21
ns: Map
member: to_tile
---
Divides a pixel position by the tile size of the <code>Solids</code> config.
```ludic
# doc-check: skip — illustrative
let tile = Map.to_tile(pixel: Collider.center(player))
```

View file

@ -0,0 +1,19 @@
---
id: map-width
name: Map.width
category: map
kind: namespace-method
tokens: Map.width
sig: Map.width() -> int
tip: The map's width in cells.
order: 18
ns: Map
member: width
---
The width set by <code>Map.size</code>.
```ludic
# doc-check: skip — illustrative
for x in 0 .. Map.width() { … }
```