feat: module interaction system with wiring panel
Add a new "module" interaction type where doors/devices define ports (in/out) and a JS verify function. Players wire their gadget's I/O to the module's ports via a canvas-rendered wiring panel, then execute to verify the circuit logic. - New wiringPanel.js: full wiring UI with keyboard nav, bezier wires, mini circuit evaluator, and verify execution - AND-gate example door in Circuit Lab (tile 9,1) - Editor support: module type with ports editor and JS verify textarea - Integrated into gameMode, worldInput, worldRenderer Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { worldState } from './worldState.js';
|
||||
import { getMap, getInteraction, getNPC, getExit, isWall } from './maps.js';
|
||||
import { updateMovement } from './worldInput.js';
|
||||
import { drawBackpack, getGadgets, drawNamingScreen, drawNotification } from './inventory.js';
|
||||
import { isWiringOpen, drawWiringPanel } from './wiringPanel.js';
|
||||
|
||||
let canvas = null;
|
||||
let ctx = null;
|
||||
@@ -145,7 +146,12 @@ export function renderWorld(timestamp) {
|
||||
drawBackpack(ctx, canvas.width, canvas.height);
|
||||
}
|
||||
|
||||
// === Layer 7: Naming screen (on top of everything including backpack) ===
|
||||
// === Layer 7: Wiring panel overlay ===
|
||||
if (isWiringOpen()) {
|
||||
drawWiringPanel(ctx, canvas.width, canvas.height);
|
||||
}
|
||||
|
||||
// === Layer 8: Naming screen (on top of everything) ===
|
||||
drawNamingScreen(ctx, canvas.width, canvas.height);
|
||||
|
||||
// === Layer 8: Notification toast ===
|
||||
|
||||
Reference in New Issue
Block a user