refactor(data): reorganitza data/ i centralitza paths a defaults.hpp
This commit is contained in:
1 parent
9949096fba
commit
05465b791e
54 files changed
+368
-304
No files matched your search
@@ -229,10 +229,10 @@ auto GameScene::defaultConfig() -> Config {
|
||||
// concret de sala — només cap a on apunta la progressió ara mateix.
|
||||
return {
|
||||
.map_yaml = Levels::LevelManager::get().currentPath(),
|
||||
.player_sprite = Defaults::Pyramid::PLAYER_SPRITE,
|
||||
.player_yaml = Defaults::Pyramid::PLAYER_YAML,
|
||||
.player2_sprite = Defaults::Pyramid::PLAYER_SPRITE_P2,
|
||||
.player2_yaml = Defaults::Pyramid::PLAYER_YAML_P2,
|
||||
.player_sprite = Defaults::Pyramid::PLAYER_SAM_GIF,
|
||||
.player_yaml = Defaults::Pyramid::PLAYER_SAM_YAML,
|
||||
.player2_sprite = Defaults::Pyramid::PLAYER_MORCUS_GIF,
|
||||
.player2_yaml = Defaults::Pyramid::PLAYER_MORCUS_YAML,
|
||||
.music_track = Defaults::Pyramid::MUSIC_TRACK,
|
||||
.starting_players = DebugConfig::StartingPlayers::BOTH,
|
||||
};
|
||||
@@ -312,7 +312,7 @@ GameScene::GameScene(Config config)
|
||||
// També ens subscrivim a `player_jumped` i `player_landed` per
|
||||
// spawnejar el polvet de despegue / aterratge a la posició dels
|
||||
// peus que el Player ens dóna al payload.
|
||||
Resource::Cache::get().loadSurface("dust.gif", "data/entities/dust/dust.gif");
|
||||
Resource::Cache::get().loadSurface("dust.gif", Defaults::Paths::DUST_GIF);
|
||||
entity_manager_.getBus().subscribe("player_jumped", [this](const Event& ev) {
|
||||
const auto* pos = std::get_if<WorldPos>(&ev.payload);
|
||||
if (pos != nullptr) { spawnDust(pos->x, pos->y, false); }
|
||||
@@ -325,10 +325,10 @@ GameScene::GameScene(Config config)
|
||||
// Whip: precarreguem les 4 surfaces (una per cardinal) abans del
|
||||
// primer spawn perquè el Player no facte disc al primer atac.
|
||||
// Subscriu `whip_spawn` per crear el `WhipAttack` corresponent.
|
||||
Resource::Cache::get().loadSurface("whip_east.gif", "data/entities/whip_attack/whip_east.gif");
|
||||
Resource::Cache::get().loadSurface("whip_west.gif", "data/entities/whip_attack/whip_west.gif");
|
||||
Resource::Cache::get().loadSurface("whip_north.gif", "data/entities/whip_attack/whip_north.gif");
|
||||
Resource::Cache::get().loadSurface("whip_south.gif", "data/entities/whip_attack/whip_south.gif");
|
||||
Resource::Cache::get().loadSurface("whip_east.gif", Defaults::Paths::WHIP_EAST_GIF);
|
||||
Resource::Cache::get().loadSurface("whip_west.gif", Defaults::Paths::WHIP_WEST_GIF);
|
||||
Resource::Cache::get().loadSurface("whip_north.gif", Defaults::Paths::WHIP_NORTH_GIF);
|
||||
Resource::Cache::get().loadSurface("whip_south.gif", Defaults::Paths::WHIP_SOUTH_GIF);
|
||||
entity_manager_.getBus().subscribe("whip_spawn", [this](const Event& ev) {
|
||||
const auto* p = std::get_if<WhipSpawnPayload>(&ev.payload);
|
||||
if (p != nullptr) { spawnWhip(*p); }
|
||||
@@ -479,7 +479,7 @@ GameScene::GameScene(Config config)
|
||||
|
||||
// Timings i corbes de la FSM de sala. Llegits del YAML una sola
|
||||
// vegada; canvis requereixen reiniciar el joc.
|
||||
transition_config_ = RoomFsm::loadConfig(Defaults::GameScene::CONFIG_YAML);
|
||||
transition_config_ = RoomFsm::loadConfig(Defaults::GameScene::GAME_YAML);
|
||||
|
||||
// Cinemàtica d'entrada de la primera sala: arrenca la pista
|
||||
// `room_intro.ogg` i arma el callback de fi que farà spawn + salt
|
||||
@@ -856,7 +856,7 @@ void GameScene::renderRoomText() {
|
||||
// l'antic GameCanvas::CENTER_Y per descomptar la franja del marcador
|
||||
// i tenir el rètol equilibrat sobre el playfield.
|
||||
const int PLAY_CENTER_Y = (GameCanvas::HEIGHT + Map::hud_h) / 2;
|
||||
// Colors del rètol via UiConfig (`data/ui.yaml > colors.room_text` i
|
||||
// Colors del rètol via UiConfig (`data/config/ui.yaml > colors.room_text` i
|
||||
// `room_text_outline`). Independents dels colors de notificació.
|
||||
const Uint8 FILL = UiConfig::get().roomText();
|
||||
const Uint8 OUTLINE = UiConfig::get().roomTextOutline();
|
||||
|
||||
Reference in new issue
Block a user