all kinds of updates

This commit is contained in:
Dan 2026-01-20 14:31:02 +00:00
parent 25815aa4d2
commit 5f2bbca38f
10 changed files with 792 additions and 216 deletions

View file

@ -6,6 +6,7 @@ class GameEngine {
this.adapter = null;
this.state = null;
this.input = null;
this.sound = null;
this.scenes = null;
this.isRunning = false;
@ -53,7 +54,13 @@ class GameEngine {
this.adapter = new TerminalAdapter(this.terminal);
this.state = new StateManager(this.definition.id);
this.input = new InputManager(this.adapter);
this.scenes = new SceneManager(this.adapter, this.state, this.input);
// Initialize sound manager if SoundManager is available
if (window.SoundManager) {
this.sound = new SoundManager(this.adapter);
}
this.scenes = new SceneManager(this.adapter, this.state, this.input, this.sound);
// Initialize state
this.state.init(this.definition.initialState || {});
@ -173,6 +180,11 @@ class GameEngine {
this.isRunning = false;
// Cleanup sound manager
if (this.sound) {
this.sound.stopAll();
}
// Cleanup input manager
if (this.input) {
this.input.destroy();