Implement core engine functionality with configuration loading and game loop

master
SanjarBLZK 1 week ago
parent 60aa9bb6d0
commit 6dfa10ca50

@ -15,7 +15,11 @@
"type": "git",
"url": "https://git.pack.house/adamdaghmah/i-love-x-engine"
},
"keywords": ["electron", "game-engine", "spelshow"],
"keywords": [
"electron",
"game-engine",
"spelshow"
],
"author": "",
"license": "ISC",
"devDependencies": {

@ -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…
Cancel
Save