-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9f8875
commit 3b6aa7f
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}; |