Comment out initPuzzleUI() call and remove puzzle_door from interaction type dropdown — all puzzle code remains intact for future re-enablement. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
// Entry point — initializes game (world + workshop modes)
|
|
import { initRenderer, resize } from './renderer.js';
|
|
import { initEvents } from './events.js';
|
|
import { initPuzzleUI } from './puzzleUI.js';
|
|
import { loadFromStorage, startAutoSave } from './saveLoad.js';
|
|
import { updateComponentButtons } from './components.js';
|
|
import { evaluateAll } from './gates.js';
|
|
import { startGame, registerCircuitEditor, enterWorldMode } from './world/gameMode.js';
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
// Register circuit editor init/destroy so gameMode can switch to workshop
|
|
registerCircuitEditor(
|
|
// init workshop
|
|
() => {
|
|
initRenderer();
|
|
initEvents();
|
|
// initPuzzleUI(); // HIDDEN: puzzle mode disabled for now
|
|
if (loadFromStorage()) {
|
|
updateComponentButtons();
|
|
evaluateAll();
|
|
}
|
|
startAutoSave(3000);
|
|
},
|
|
// destroy workshop (cleanup when switching back to world)
|
|
() => {
|
|
// Auto-save is fine to leave running
|
|
}
|
|
);
|
|
|
|
// Add back-to-world button handler
|
|
const backBtn = document.getElementById('back-to-world-btn');
|
|
if (backBtn) {
|
|
backBtn.addEventListener('click', () => {
|
|
enterWorldMode();
|
|
});
|
|
}
|
|
|
|
// Start the game in world mode
|
|
startGame();
|
|
});
|