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:
- type: BITMAP
path: ${PREFIX}/data/player/player.gif
path: ${PREFIX}/data/player/player_spritesheet.gif
- type: ANIMATION
path: ${PREFIX}/data/player/player.yaml
path: ${PREFIX}/data/player/player_animations.yaml
# MUSIC
music:
@@ -110,6 +110,6 @@ assets:
# ENEMIES
enemies:
- type: BITMAP
path: ${PREFIX}/data/enemies/code.gif
path: ${PREFIX}/data/enemies/code_spritesheet.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/code.yaml
path: ${PREFIX}/data/enemies/code_animations.yaml

View File

@@ -1,5 +1,5 @@
# code animation
tileSetFile: code.gif
tileSetFile: code_spritesheet.gif
frameWidth: 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
tileSetFile: player.gif
tileSetFile: player_spritesheet.gif
frameWidth: 8
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
enemies:
- animation: code.yaml
- animation: code_animations.yaml
position: {x: 1, y: 17}
velocity: {x: 24.0, y: 0}
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;
} else if (argument == "--invincible") {
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 {
constexpr bool INFINITE_LIVES = false; // Vidas infinitas desactivadas por defecto
constexpr bool INVINCIBLE = false; // Invencibilidad desactivada por defecto
constexpr bool ALTERNATE_SKIN = false; // Skin alternativa desactivada por defecto
} // namespace Cheat
// --- CONTROLS ---

View File

@@ -21,8 +21,7 @@ Scoreboard::Scoreboard(std::shared_ptr<Data> data)
constexpr float SURFACE_HEIGHT = ScoreboardArea::HEIGHT;
// 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>(player_animation_data);
player_sprite_ = std::make_shared<SurfaceAnimatedSprite>(Resource::Cache::get()->getAnimationData("player_animations.yaml"));
player_sprite_->setCurrentAnimation("walk_menu");
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 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
[[nodiscard]] auto enabled() const -> bool {

View File

@@ -661,7 +661,7 @@ void Game::togglePause() {
// Inicializa al jugador
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);
}