parent
60aa9bb6d0
commit
6dfa10ca50
@ -0,0 +1,26 @@
|
|||||||
|
const ConfigLoader = require('./core/config-loader');
|
||||||
|
const AssetManager = require('./core/asset-manager');
|
||||||
|
const EventBus = require('./core/event-bus');
|
||||||
|
const GameLoop = require('./core/game-loop');
|
||||||
|
|
||||||
|
// Config pad kan via argumenten komen, standaard default.json
|
||||||
|
const configPath = process.argv[2] || '../configs/default.json';
|
||||||
|
const config = ConfigLoader.load(configPath);
|
||||||
|
|
||||||
|
const assetManager = new AssetManager(config.assetsDir || '../assets/default');
|
||||||
|
assetManager.loadAssets();
|
||||||
|
|
||||||
|
const eventBus = new EventBus();
|
||||||
|
|
||||||
|
const gameLoop = new GameLoop({
|
||||||
|
onUpdate: () => {
|
||||||
|
// Hier komt de game logica per tick
|
||||||
|
console.log('Game update');
|
||||||
|
},
|
||||||
|
onEnd: () => {
|
||||||
|
console.log('Game ended');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('Engine gestart met config:', configPath);
|
||||||
|
gameLoop.start();
|
Loading…
Reference in new issue