feat(entities): migrar bullet a data/entities/bullet/bullet.yaml

This commit is contained in:
2026-05-25 11:42:43 +02:00
parent 5fb6c68df4
commit bea844d51e
12 changed files with 306 additions and 107 deletions
+8
View File
@@ -15,6 +15,7 @@
#include "core/locale/locale.hpp"
#include "core/system/scene_context.hpp"
#include "core/system/service_menu.hpp"
#include "game/entities/bullet_registry.hpp"
#include "game/entities/enemy_registry.hpp"
#include "game/entities/player_config.hpp"
#include "game/stage_system/stage_loader.hpp"
@@ -72,6 +73,13 @@ GameScene::GameScene(SDLManager& sdl, SceneContext& context)
std::exit(EXIT_FAILURE);
}
// Carregar la configuració de la bala. Cal abans de construir el pool de
// bullets, ja que cada Bullet llegeix el registry al seu ctor.
if (!BulletRegistry::load()) {
std::cerr << "[GameScene] FATAL: no s'ha pogut carregar bullet.yaml\n";
std::exit(EXIT_FAILURE);
}
// Inicialitzar naves: P1 amb el shape del YAML, P2 amb override visual.
ships_[0] = Ship(sdl.getRenderer(), *player_config); // Jugador 1: nau estàndard
ships_[1] = Ship(sdl.getRenderer(), *player_config, "ship2.shp"); // Jugador 2: interceptor amb ales