fix(render): iso/3d face movement dir; 3d crash-proof; brighter ASCII walls

- Iso & 3D character faced the wrong way: the SP game never sends player.facing (only the tavern
  does) so it defaulted to down/SW. Both renderers now INFER facing from the movement delta they
  already track (explicit e.facing still wins for the tavern).
- 3D could break the game: wrap ThreeRenderer construction (createRenderer) and the _animate RAF
  body in try/catch — a 3D failure now falls back to Tiled / stops the loop instead of throwing.
- ASCII walls/floors were near-invisible (legend colours are near-black, tuned for tile fog): use
  brighter glyph colours for wall/floor in ASCII (features keep their own colours).
This commit is contained in:
jwinterm
2026-07-14 14:24:51 -04:00
parent 11732531d2
commit 263bfb1cf4
4 changed files with 39 additions and 9 deletions
+7 -1
View File
@@ -51,7 +51,13 @@
if (!RK.canUseMode(mode)) return new RK.TileRenderer(host, opts);
if (mode === 'ascii' && RK.AsciiRenderer) return new RK.AsciiRenderer(host, opts);
if (mode === 'iso' && RK.IsoRenderer) return new RK.IsoRenderer(host, opts);
if (mode === '3d' && RK.ThreeRenderer && RK.THREE) return new RK.ThreeRenderer(host, opts);
if (mode === '3d' && RK.ThreeRenderer && RK.THREE) {
try { return new RK.ThreeRenderer(host, opts); }
catch (e) {
if (root.console) console.warn('3D renderer failed; using tiled:', e && e.message);
return new RK.TileRenderer(host, opts);
}
}
if (mode === 'fancy') {
try {
if (!RK.FancyRenderer) throw new Error('fancy renderer not loaded');