From d30e62f02fff79954808742160deba06e6d958ba Mon Sep 17 00:00:00 2001 From: jwinterm Date: Sun, 12 Jul 2026 20:18:15 -0400 Subject: [PATCH] fix(render): dungeon torches mount on walls with a fixture sprite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Torches replace WALL cells adjacent to floor (dungeon.js), but the Tiled renderer based the torch on a floor tile and drew only a procedural flame — so they read as flames floating on the floor. Base the dungeon torch on `wall` and draw the pack torch sprite over it, then RK.fx animates the flame/glow on top: a proper wall-mounted sconce. Fire fixtures now composite base + sprite + flame (hazards keep base + pulse, no sprite). --- html/js/render/sceneModel.js | 4 +++- html/js/render/tileRenderer.js | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/html/js/render/sceneModel.js b/html/js/render/sceneModel.js index 99550e3..1b961fa 100644 --- a/html/js/render/sceneModel.js +++ b/html/js/render/sceneModel.js @@ -104,7 +104,9 @@ entrance: { char: '<', color: '#3fb950', solid: false }, exit: { char: '>', color: '#d29922', solid: false }, treasure: { char: '$', color: '#fbbf24', solid: false }, - torch: { char: 'i', color: '#d29922', solid: false, fx: 'fire', fxScale: 0.34 }, + // The generator only places torches on WALL cells adjacent to floor, so the fixture is + // wall-mounted: base on `wall`, draw the torch sprite over it, then RK.fx animates the flame. + torch: { char: 'i', color: '#d29922', solid: false, over: 'wall', fx: 'fire', fxScale: 0.34 }, // Hazard zones. The base tile stays walkable/ground; RK.fx paints the pulsing overlay. These // render as soon as the dungeon generator emits their chars (L/P/^) in the tile stream. lava: { char: '≈', color: '#7a2a0e', solid: false, hazard: 'lava' }, diff --git a/html/js/render/tileRenderer.js b/html/js/render/tileRenderer.js index 0b2914f..3d4b266 100644 --- a/html/js/render/tileRenderer.js +++ b/html/js/render/tileRenderer.js @@ -117,6 +117,13 @@ ctx.fillStyle = bdef.color || def.color; ctx.fillRect(px, py, cell, cell); } + // Fire fixtures (torch/hearth) carry a sprite — draw the sconce/torch tile over + // its base so it reads as a mounted FIXTURE, not a bare procedural flame; RK.fx + // then animates the flame + glow on top. Hazards (lava/poison/spikes) have no sprite. + if (def.fx === 'fire' && useAtlas) { + var fco = pickVariant(tmap[kind], x, y); + if (fco) atlas.draw(ctx, fco[0], fco[1], px, py, cell); + } applyCellLight(ctx, scene, x, y, px, py, cell); continue; }