fix(tavern): render the reliable procedural room, drop the goblin 'cat'

- The imported .tmx tavern room renders as a block-scatter in the browser (the
  client falls back to the walkable grid, drawing furniture/walls as generic
  blocks). Gate it behind TAVERN_DESIGNED_ROOM=true and default to the hand-built
  procedural tavern (tavernMap.js) — bar + tables + walls — which renders reliably
  through the theme atlas.
- Remove the tavern 'cat': it used the char-goblin sprite, so it read as a green
  monster stuck in the wall. Gone until there's a real critter sprite.
This commit is contained in:
jwinterm
2026-07-10 22:44:26 -04:00
parent 588250e5a9
commit 3eb4959e9a
2 changed files with 12 additions and 11 deletions
+2 -6
View File
@@ -219,12 +219,8 @@
}));
}
// Cat — a small wandering creature.
var catSpot = findFloor(3, rows - 3);
this.npcs.push(makeNPC('cat', 'cat', 'char-goblin', catSpot.x, catSpot.y, {
label: null, color: '#e8a060', role: 'cat',
roamArea: catArea(cols, rows)
}));
// (No "cat": it used the char-goblin sprite, which read as a green monster stuck in the
// wall. Left out until there's an actual pet/critter sprite.)
};
TavernLife.prototype._pickTarget = function (npc, scene) {
+10 -5
View File
@@ -198,11 +198,16 @@ class SocketHandlers {
// Load the designed tavern room (imported .tmx); fall back to the procedural map if absent.
let tavernRoomData = null;
const tavernRoomUrl = 'assets/kenney/tavern_room.json';
try {
const roomPath = require('path').join(__dirname, '../../html', tavernRoomUrl);
tavernRoomData = JSON.parse(require('fs').readFileSync(roomPath, 'utf8'));
} catch (e) {
if (this.debugManager.CONSOLE_LOGGING) console.log('Tavern room JSON not found; using default map:', e.message);
// The imported .tmx room renders as a block-scatter in the browser (the client falls back to
// the walkable grid), so use the hand-built procedural tavern (tavernMap.js) — which renders
// reliably through the theme atlas — by default. Opt back into the .tmx with TAVERN_DESIGNED_ROOM=true.
if (process.env.TAVERN_DESIGNED_ROOM === 'true') {
try {
const roomPath = require('path').join(__dirname, '../../html', tavernRoomUrl);
tavernRoomData = JSON.parse(require('fs').readFileSync(roomPath, 'utf8'));
} catch (e) {
if (this.debugManager.CONSOLE_LOGGING) console.log('Tavern room JSON not found; using default map:', e.message);
}
}
this.tavernManager = new TavernManager({
io: this.io,