animacions noves per al jugador2,

cada jugador te el seu fitxer d'animacions per separat
This commit is contained in:
2025-10-21 20:42:17 +02:00
parent bf12c1664a
commit 9b8fdf289f
8 changed files with 163 additions and 17 deletions

View File

@@ -354,7 +354,8 @@ void Credits::throwBalloons(float delta_time) {
// Inicializa los jugadores
void Credits::initPlayers() {
std::vector<std::vector<std::shared_ptr<Texture>>> player_textures; // Vector con todas las texturas de los jugadores;
std::vector<std::vector<std::string>> player_animations; // Vector con las animaciones del jugador
std::vector<std::vector<std::string>> player1_animations; // Vector con las animaciones del jugador 1
std::vector<std::vector<std::string>> player2_animations; // Vector con las animaciones del jugador 2
// Texturas - Player1
std::vector<std::shared_ptr<Texture>> player1_textures;
@@ -375,8 +376,10 @@ void Credits::initPlayers() {
player_textures.push_back(player2_textures);
// Animaciones -- Jugador
player_animations.emplace_back(Resource::get()->getAnimation("player.ani"));
player_animations.emplace_back(Resource::get()->getAnimation("player_power.ani"));
player1_animations.emplace_back(Resource::get()->getAnimation("player1.ani"));
player1_animations.emplace_back(Resource::get()->getAnimation("player_power.ani"));
player2_animations.emplace_back(Resource::get()->getAnimation("player2.ani"));
player2_animations.emplace_back(Resource::get()->getAnimation("player_power.ani"));
// Crea los dos jugadores
const int Y = play_area_.y + play_area_.h - Player::WIDTH;
@@ -390,7 +393,7 @@ void Credits::initPlayers() {
config_player1.demo = DEMO;
config_player1.play_area = &play_area_;
config_player1.texture = player_textures.at(0);
config_player1.animations = player_animations;
config_player1.animations = player1_animations;
config_player1.hi_score_table = &Options::settings.hi_score_table;
config_player1.glowing_entry = &Options::settings.glowing_entries.at(static_cast<int>(Player::Id::PLAYER1) - 1);
players_.emplace_back(std::make_unique<Player>(config_player1));
@@ -404,7 +407,7 @@ void Credits::initPlayers() {
config_player2.demo = DEMO;
config_player2.play_area = &play_area_;
config_player2.texture = player_textures.at(1);
config_player2.animations = player_animations;
config_player2.animations = player2_animations;
config_player2.hi_score_table = &Options::settings.hi_score_table;
config_player2.glowing_entry = &Options::settings.glowing_entries.at(static_cast<int>(Player::Id::PLAYER2) - 1);
players_.emplace_back(std::make_unique<Player>(config_player2));