Skip to content

Commit

Permalink
Update engine.js
Browse files Browse the repository at this point in the history
  • Loading branch information
CleanCode-developer authored Dec 31, 2024
1 parent d9f8875 commit 3b6aa7f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions js/engine.js
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
import Renderer from './renderer.js';
import SceneManager from './sceneManager.js';
import InputHandler from './inputHandler.js';
import ExportGame from './exportGame.js';
import UIHandler from './uiHandler.js';

class Engine {
constructor() {
this.renderer = new Renderer();
this.sceneManager = new SceneManager();
this.inputHandler = new InputHandler();
this.exportGame = new ExportGame(this.sceneManager);
this.uiHandler = new UIHandler(this.sceneManager);

this.init();
}

init() {
// Initialize scenes and other components
this.loop();
}

loop() {
requestAnimationFrame(() => this.loop());
this.sceneManager.update();
this.renderer.render(); // Render with Three.js
}
}

window.onload = () => {
const engine = new Engine();
};

0 comments on commit 3b6aa7f

Please sign in to comment.