refactor de noms de resources en data/

This commit is contained in:
2025-11-26 13:57:25 +01:00
parent 61c6b9087c
commit 78a0200856
11 changed files with 9 additions and 14 deletions

View File

@@ -66,9 +66,9 @@ assets:
# PLAYER # PLAYER
player: player:
- type: BITMAP - type: BITMAP
path: ${PREFIX}/data/player/player.gif path: ${PREFIX}/data/player/player_spritesheet.gif
- type: ANIMATION - type: ANIMATION
path: ${PREFIX}/data/player/player.yaml path: ${PREFIX}/data/player/player_animations.yaml
# MUSIC # MUSIC
music: music:
@@ -110,6 +110,6 @@ assets:
# ENEMIES # ENEMIES
enemies: enemies:
- type: BITMAP - type: BITMAP
path: ${PREFIX}/data/enemies/code.gif path: ${PREFIX}/data/enemies/code_spritesheet.gif
- type: ANIMATION - type: ANIMATION
path: ${PREFIX}/data/enemies/code.yaml path: ${PREFIX}/data/enemies/code_animations.yaml

View File

@@ -1,5 +1,5 @@
# code animation # code animation
tileSetFile: code.gif tileSetFile: code_spritesheet.gif
frameWidth: 16 frameWidth: 16
frameHeight: 16 frameHeight: 16

View File

Before

Width:  |  Height:  |  Size: 346 B

After

Width:  |  Height:  |  Size: 346 B

View File

@@ -1,5 +1,5 @@
# player animation # player animation
tileSetFile: player.gif tileSetFile: player_spritesheet.gif
frameWidth: 8 frameWidth: 8
frameHeight: 16 frameHeight: 16

View File

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B

View File

@@ -76,7 +76,7 @@ collisionmap:
# Enemigos en esta habitación # Enemigos en esta habitación
enemies: enemies:
- animation: code.yaml - animation: code_animations.yaml
position: {x: 1, y: 17} position: {x: 1, y: 17}
velocity: {x: 24.0, y: 0} velocity: {x: 24.0, y: 0}
boundaries: boundaries:

View File

@@ -182,8 +182,6 @@ auto Director::checkProgramArguments(std::vector<std::string> const& args) -> st
Options::cheats.infinite_lives = Options::Cheat::State::ENABLED; Options::cheats.infinite_lives = Options::Cheat::State::ENABLED;
} else if (argument == "--invincible") { } else if (argument == "--invincible") {
Options::cheats.invincible = Options::Cheat::State::ENABLED; Options::cheats.invincible = Options::Cheat::State::ENABLED;
} else if (argument == "--altSkin") {
Options::cheats.alternate_skin = Options::Cheat::State::ENABLED;
} }
} }

View File

@@ -73,7 +73,6 @@ constexpr const char* NOTIFY = "notify.wav"; // Sonido de notificación
namespace Cheat { namespace Cheat {
constexpr bool INFINITE_LIVES = false; // Vidas infinitas desactivadas por defecto constexpr bool INFINITE_LIVES = false; // Vidas infinitas desactivadas por defecto
constexpr bool INVINCIBLE = false; // Invencibilidad desactivada por defecto constexpr bool INVINCIBLE = false; // Invencibilidad desactivada por defecto
constexpr bool ALTERNATE_SKIN = false; // Skin alternativa desactivada por defecto
} // namespace Cheat } // namespace Cheat
// --- CONTROLS --- // --- CONTROLS ---

View File

@@ -21,8 +21,7 @@ Scoreboard::Scoreboard(std::shared_ptr<Data> data)
constexpr float SURFACE_HEIGHT = ScoreboardArea::HEIGHT; constexpr float SURFACE_HEIGHT = ScoreboardArea::HEIGHT;
// Reserva memoria para los objetos // Reserva memoria para los objetos
const auto& player_animation_data = Resource::Cache::get()->getAnimationData(Options::cheats.alternate_skin == Options::Cheat::State::ENABLED ? "player2.yaml" : "player.yaml"); player_sprite_ = std::make_shared<SurfaceAnimatedSprite>(Resource::Cache::get()->getAnimationData("player_animations.yaml"));
player_sprite_ = std::make_shared<SurfaceAnimatedSprite>(player_animation_data);
player_sprite_->setCurrentAnimation("walk_menu"); player_sprite_->setCurrentAnimation("walk_menu");
surface_ = std::make_shared<Surface>(SURFACE_WIDTH, SURFACE_HEIGHT); surface_ = std::make_shared<Surface>(SURFACE_WIDTH, SURFACE_HEIGHT);

View File

@@ -38,7 +38,6 @@ struct Cheat {
State infinite_lives{Defaults::Cheat::INFINITE_LIVES ? State::ENABLED : State::DISABLED}; // Indica si el jugador dispone de vidas infinitas State infinite_lives{Defaults::Cheat::INFINITE_LIVES ? State::ENABLED : State::DISABLED}; // Indica si el jugador dispone de vidas infinitas
State invincible{Defaults::Cheat::INVINCIBLE ? State::ENABLED : State::DISABLED}; // Indica si el jugador puede morir State invincible{Defaults::Cheat::INVINCIBLE ? State::ENABLED : State::DISABLED}; // Indica si el jugador puede morir
State alternate_skin{Defaults::Cheat::ALTERNATE_SKIN ? State::ENABLED : State::DISABLED}; // Indica si se usa una skin diferente para el jugador
// Método para comprobar si alguno de los trucos está activo // Método para comprobar si alguno de los trucos está activo
[[nodiscard]] auto enabled() const -> bool { [[nodiscard]] auto enabled() const -> bool {

View File

@@ -661,7 +661,7 @@ void Game::togglePause() {
// Inicializa al jugador // Inicializa al jugador
void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr<Room> room) { void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr<Room> room) {
const Player::Data PLAYER{.spawn_data = spawn_point, .animations_path = "player.yaml", .room = std::move(room)}; const Player::Data PLAYER{.spawn_data = spawn_point, .animations_path = "player_animations.yaml", .room = std::move(room)};
player_ = std::make_shared<Player>(PLAYER); player_ = std::make_shared<Player>(PLAYER);
} }