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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user