feat(fx): RK.fx juice engine — animated torch/hearth flame + glow, hazard tiles

The shared "juice" layer, pure-canvas (CSP-safe, no WebGL/shaders), driven off a
clock so both renderers light a scene the same way:

- html/js/render/fxLayer.js (NEW): RK.fx — layered-sine flame flicker, additive
  warm glow, a dancing two-layer canvas flame, and pulsing hazard overlays
  (lava/poison/spikes) with a footprint-clip callback so it fits square cells
  and iso diamonds alike.
- Tavern now has FIRE: 4 corner braziers + a hearth on the left wall throw real
  flickering light. Placed along walls, clear of spawn/aisles/tables.
- Both renderers: torch/hearth/hazard tiles draw only their FLOOR base in the
  static pass (no more solid amber block), then RK.fx paints the animated flame
  / hazard pulse in the live loop. Tiled caches emitter positions and draws them
  over the vignette so light punches through the dark edges; iso adds them as
  depth-sorted fx items and keeps its RAF alive while any fire/hazard is onscreen.
- Dungeon hazard zones wired end-to-end in the scene model (lava L / poison P /
  spikes ^ chars -> pulsing tiles) — they render the moment the generator emits
  them; no client-authoritative fakes.
- fxLayer.js included in tavern.html + match.html.

Suite 58/419 green; render files node --check clean.
This commit is contained in:
jwinterm
2026-07-11 17:00:43 -04:00
parent 4d673748df
commit 11de46a7e4
7 changed files with 224 additions and 10 deletions
+10 -5
View File
@@ -51,13 +51,18 @@ function buildDefaultTavern(cols = 28, rows = 15) {
// Corner decor — barrels and crates.
put(1, 1, 'B'); put(cols - 2, 1, 'C'); put(1, rows - 2, 'C'); put(cols - 2, rows - 2, 'B');
// Barrels & crates lining the side walls (one in from the wall, clear of the windows/spawn) so
// the room reads lived-in instead of a big empty floor. Alternating B/C for material variety.
// Fixtures lining the room so it reads lived-in instead of a big empty floor: barrels/crates
// (material variety) plus fire fixtures — braziers ('i') throwing flickering light in the
// corners and a hearth ('F') anchoring the left wall. All solid, all clear of windows/spawn/
// tables/aisles. The renderers paint the animated flame + glow on the fire tiles.
const wallDecor = [
[1, 5, 'B'], [1, 9, 'C'], [1, 12, 'B'],
[cols - 2, 5, 'C'], [cols - 2, 9, 'B'], [cols - 2, 12, 'C'],
[1, 6, 'B'], [1, 10, 'C'],
[cols - 2, 6, 'C'], [cols - 2, 10, 'B'],
[2, rows - 2, 'B'], [cols - 3, rows - 2, 'C'],
[barX0 - 1, barY + 1, 'B'], [barX1 + 1, barY + 1, 'C'] // a barrel/crate tucked beside each keg
[barX0 - 1, barY + 1, 'B'], [barX1 + 1, barY + 1, 'C'], // a barrel/crate tucked beside each keg
[1, 4, 'i'], [cols - 2, 4, 'i'], // braziers flanking the bar
[1, rows - 3, 'i'], [cols - 2, rows - 3, 'i'], // braziers in the lower corners
[1, 8, 'F'] // hearth on the left wall
];
for (const [dx, dy, dch] of wallDecor) put(dx, dy, dch);