feat: add F3 debug overlay for collision visualization

Press F3 to toggle a debug overlay that shows:
- Red tiles: walls (collision)
- Green tiles: exits (map transitions)
- Yellow tiles: interactions (workshop, signs, doors)
- Purple tiles: NPCs
- Green border: current player tile
- Coordinate labels on nearby tiles
- Legend bar with player position and current map

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jose Luis
2026-03-20 16:23:09 +01:00
parent 9b2a25856e
commit bf34879390
2 changed files with 120 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
// worldInput.js - Keyboard input for world mode
import { worldState, advanceDialog, startDialog } from './worldState.js';
import { getMap, getInteraction, getNPC, getExit, isWalkable } from './maps.js';
import { toggleDebug } from './worldRenderer.js';
const keysDown = new Set();
let interactionHandler = null;
@@ -35,6 +36,13 @@ function onKeyDown(e) {
return;
}
// Debug overlay toggle (F3)
if (key === 'F3') {
e.preventDefault();
toggleDebug();
return;
}
// Workshop shortcut (TAB)
if (key === 'Tab') {
e.preventDefault();