mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-17 22:31:26 +02:00
fix(render): dungeon torches mount on walls with a fixture sprite
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).
This commit is contained in:
@@ -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' },
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user