fix(iso): infer facing (not always down) + render features as tiles not avatars

Two iso bugs from reusing the tavern renderer for the SP dungeon:
- Character always faced down/SW: sceneFromGameState hardcoded facing:"down", so the renderers
  ignored their movement-inferred facing (truthy default won). Now facing defaults to null (SP
  server sends none) so iso/3D infer it from movement; facingDelta(null)=down keeps tiled fine.
- "Copy of himself at the origin": the iso renderer drew EVERY entity via _charFrame, so the
  entrance feature rendered as a male character at the start. Features/items now draw as pack tiles
  (stairs/chest) or a glyph; monsters get a red tint so they do not read as a second player.
This commit is contained in:
jwinterm
2026-07-14 14:45:50 -04:00
parent 263bfb1cf4
commit df6a270d2d
2 changed files with 38 additions and 2 deletions
+3 -1
View File
@@ -251,7 +251,9 @@ function sceneFromGameState(state, opts) {
var playerEntity = {
id: 'player', x: state.player.x, y: state.player.y,
kind: 'player', char: '@', color: '#9aa4b2',
facing: state.player.facing || 'down', label: null,
// No bogus default: the SP server doesn't send facing, so leave it null and let the iso/3D
// renderers INFER facing from movement. A hardcoded 'down' made them always face down/SW.
facing: state.player.facing || null, label: null,
you: !state.isSpectating
};
// Attach the player's appearance if available (for render-kit character rendering).