feat(game_core): 重构游戏引擎并添加新功能

- 重构了游戏引擎的核心逻辑和架构
- 添加了新的实体组件系统(ECS)
- 实现了简单的碰撞检测和响应
- 新增了地图和子弹功能
- 优化了输入处理和渲染逻辑
- 调整了游戏控制方式
This commit is contained in:
ZZY
2025-07-02 12:14:57 +08:00
parent 89bede93a9
commit b5b2c90e75
32 changed files with 856 additions and 441 deletions

View File

@@ -29,10 +29,11 @@ static inline void ge_init(ge_core_t* core) {
}
ge_render_system_init(&core->_systems.render, &core->_render);
// TODO using other storage system
core->_systems.render.ecs = &core->ecs.storage;
core->ecs.storage.count = 0;
core->_systems.render.ecs = &core->ecs.storage;
core->_systems.physics.ecs = &core->ecs.storage;
core->_systems.collision.ecs = &core->ecs.storage;
}
void ge_engine_run(ge_core_t *core) {
@@ -45,6 +46,7 @@ void ge_engine_run(ge_core_t *core) {
ge_physics_system_run_all(&core->_systems.physics);
GE_SAFE_CALL(core->callbacks.process, core);
ge_collision_system_run_all(&core->_systems.collision);
ge_render_system_draw_all(&core->_systems.render);
GE_SAFE_CALL(core->_render.func_flush, &core->_render);