File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import Renderer from './renderer.js' ;
2+ import SceneManager from './sceneManager.js' ;
3+ import InputHandler from './inputHandler.js' ;
4+ import ExportGame from './exportGame.js' ;
5+ import UIHandler from './uiHandler.js' ;
16
7+ class Engine {
8+ constructor ( ) {
9+ this . renderer = new Renderer ( ) ;
10+ this . sceneManager = new SceneManager ( ) ;
11+ this . inputHandler = new InputHandler ( ) ;
12+ this . exportGame = new ExportGame ( this . sceneManager ) ;
13+ this . uiHandler = new UIHandler ( this . sceneManager ) ;
14+
15+ this . init ( ) ;
16+ }
17+
18+ init ( ) {
19+ // Initialize scenes and other components
20+ this . loop ( ) ;
21+ }
22+
23+ loop ( ) {
24+ requestAnimationFrame ( ( ) => this . loop ( ) ) ;
25+ this . sceneManager . update ( ) ;
26+ this . renderer . render ( ) ; // Render with Three.js
27+ }
28+ }
29+
30+ window . onload = ( ) => {
31+ const engine = new Engine ( ) ;
32+ } ;
You can’t perform that action at this time.
0 commit comments