diff --git a/config/assets.txt b/config/assets.txt index 804d95a..0f030e2 100644 --- a/config/assets.txt +++ b/config/assets.txt @@ -178,7 +178,8 @@ PALETTE|${PREFIX}/data/gfx/player/player2_invencible.pal # Animaciones del jugador ANIMATION|${PREFIX}/data/gfx/player/player_power.ani -ANIMATION|${PREFIX}/data/gfx/player/player.ani +ANIMATION|${PREFIX}/data/gfx/player/player1.ani +ANIMATION|${PREFIX}/data/gfx/player/player2.ani # Fuentes de texto BITMAP|${PREFIX}/data/font/04b_25_2x.png diff --git a/data/gfx/player/player.ani b/data/gfx/player/player1.ani similarity index 100% rename from data/gfx/player/player.ani rename to data/gfx/player/player1.ani diff --git a/data/gfx/player/player2.ani b/data/gfx/player/player2.ani new file mode 100644 index 0000000..c6aa522 --- /dev/null +++ b/data/gfx/player/player2.ani @@ -0,0 +1,135 @@ +frame_width=32 +frame_height=32 + +[animation] +name=walk +speed=0.0833 +loop=0 +frames=0,1,2,3 +[/animation] + +[animation] +name=stand +speed=0.167 +loop=0 +frames=4,5,6,7 +[/animation] + +[animation] +name=walk-fire-side +speed=0.0833 +loop=0 +frames=8,9,10,11 +[/animation] + +[animation] +name=walk-recoil-side +speed=0.0833 +loop=0 +frames=12,13,14,15 +[/animation] + +[animation] +name=walk-cool-side +speed=0.0833 +loop=0 +frames=16,17,18,19 +[/animation] + +[animation] +name=stand-fire-side +speed=0.0833 +loop=0 +frames=20 +[/animation] + +[animation] +name=stand-recoil-side +speed=0.0833 +loop=0 +frames=21 +[/animation] + +[animation] +name=stand-cool-side +speed=0.0833 +loop=0 +frames=22 +[/animation] + +[animation] +name=walk-fire-center +speed=0.0833 +loop=0 +frames=23,24,25,26 +[/animation] + +[animation] +name=walk-recoil-center +speed=0.0833 +loop=0 +frames=27,28,29,30 +[/animation] + +[animation] +name=walk-cool-center +speed=0.0833 +loop=0 +frames=31,32,33,34 +[/animation] + +[animation] +name=stand-fire-center +speed=0.0833 +loop=0 +frames=35 +[/animation] + +[animation] +name=stand-recoil-center +speed=0.0833 +loop=0 +frames=36 +[/animation] + +[animation] +name=stand-cool-center +speed=0.0833 +loop=0 +frames=37 +[/animation] + +[animation] +name=rolling +speed=0.167 +loop=0 +frames=38,39,40,41 +[/animation] + +[animation] +name=celebration +speed=0.167 +loop=0 +frames=47,47,47,47,47,47,48,49,50,51,51,51,51,51,51,50,50,50,51,51,51,50,50,50,49,48,47,47,47,42,42,42,43,44,45,46,45,46,45,46,45,46,45,46,45,46,45,44,43,42 +[/animation] + +[animation] +name=dizzy +speed=0.0833 +loop=0 +frames=52,53,54,55,56,57,58 +[/animation] + +[animation] +name=recover +speed=0.05 +loop=-1 +frames=59,59,59,59,60,61,62,63,63,63,64,65,66,63,64,65,66,63,64,65,66,67,67,67,67 +[/animation] + +[animation] +name=hello +speed=0.05 +loop=-1 +frames=68,69,70,71,72,73,74,75,76,77,78,78,78,78,78,78,78,78,78,78,78,78,78,79,80,81,82,83,84,85,86,87,87,86,85,84,84,85,86,87,87,86,85,84,84,85,86,87,87,86,85,84,84,85,86,87,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68 +[/animation] diff --git a/data/gfx/player/player2.gif b/data/gfx/player/player2.gif index ec9e556..beb5f0e 100644 Binary files a/data/gfx/player/player2.gif and b/data/gfx/player/player2.gif differ diff --git a/source/sections/credits.cpp b/source/sections/credits.cpp index 8ff4830..f722dae 100644 --- a/source/sections/credits.cpp +++ b/source/sections/credits.cpp @@ -354,7 +354,8 @@ void Credits::throwBalloons(float delta_time) { // Inicializa los jugadores void Credits::initPlayers() { std::vector>> player_textures; // Vector con todas las texturas de los jugadores; - std::vector> player_animations; // Vector con las animaciones del jugador + std::vector> player1_animations; // Vector con las animaciones del jugador 1 + std::vector> player2_animations; // Vector con las animaciones del jugador 2 // Texturas - Player1 std::vector> 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(Player::Id::PLAYER1) - 1); players_.emplace_back(std::make_unique(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(Player::Id::PLAYER2) - 1); players_.emplace_back(std::make_unique(config_player2)); diff --git a/source/sections/game.cpp b/source/sections/game.cpp index a50799e..8c7c8f9 100644 --- a/source/sections/game.cpp +++ b/source/sections/game.cpp @@ -204,9 +204,12 @@ void Game::setResources() { player_textures_.push_back(player2_textures); // Animaciones -- Jugador - player_animations_.clear(); - player_animations_.emplace_back(Resource::get()->getAnimation("player.ani")); - player_animations_.emplace_back(Resource::get()->getAnimation("player_power.ani")); + player1_animations_.clear(); + player1_animations_.emplace_back(Resource::get()->getAnimation("player1.ani")); + player1_animations_.emplace_back(Resource::get()->getAnimation("player_power.ani")); + player2_animations_.clear(); + player2_animations_.emplace_back(Resource::get()->getAnimation("player2.ani")); + player2_animations_.emplace_back(Resource::get()->getAnimation("player_power.ani")); // Animaciones -- Items item_animations_.clear(); @@ -1613,7 +1616,7 @@ void Game::initPlayers(Player::Id player_id) { .demo = demo_.enabled, .play_area = ¶m.game.play_area.rect, .texture = player_textures_.at(0), - .animations = player_animations_, + .animations = player1_animations_, .hi_score_table = &Options::settings.hi_score_table, .glowing_entry = &Options::settings.glowing_entries.at(static_cast(Player::Id::PLAYER1) - 1), .stage_info = stage_manager_.get()}; @@ -1640,7 +1643,7 @@ void Game::initPlayers(Player::Id player_id) { .demo = demo_.enabled, .play_area = ¶m.game.play_area.rect, .texture = player_textures_.at(1), - .animations = player_animations_, + .animations = player2_animations_, .hi_score_table = &Options::settings.hi_score_table, .glowing_entry = &Options::settings.glowing_entries.at(static_cast(Player::Id::PLAYER2) - 1), .stage_info = stage_manager_.get()}; diff --git a/source/sections/game.hpp b/source/sections/game.hpp index 7a82485..d759727 100644 --- a/source/sections/game.hpp +++ b/source/sections/game.hpp @@ -134,7 +134,8 @@ class Game { std::vector> game_text_textures_; // Vector con las texturas para los sprites con textos std::vector> item_animations_; // Vector con las animaciones de los items - std::vector> player_animations_; // Vector con las animaciones del jugador + std::vector> player1_animations_; // Vector con las animaciones del jugador 1 + std::vector> player2_animations_; // Vector con las animaciones del jugador 2 std::unique_ptr pause_manager_; // Objeto para gestionar la pausa std::unique_ptr stage_manager_; // Objeto para gestionar las fases diff --git a/source/sections/title.cpp b/source/sections/title.cpp index 407c208..f102dfb 100644 --- a/source/sections/title.cpp +++ b/source/sections/title.cpp @@ -506,7 +506,8 @@ void Title::setState(State state) { // Inicializa los jugadores void Title::initPlayers() { std::vector>> player_textures; // Vector con todas las texturas de los jugadores; - std::vector> player_animations; // Vector con las animaciones del jugador + std::vector> player1_animations; // Vector con las animaciones del jugador 1 + std::vector> player2_animations; // Vector con las animaciones del jugador 2 // Texturas - Player1 std::vector> player1_textures; @@ -527,8 +528,10 @@ void Title::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 = param.title.press_start_position - (Player::HEIGHT / 2); @@ -541,7 +544,7 @@ void Title::initPlayers() { config_player1.demo = DEMO; config_player1.play_area = ¶m.game.play_area.rect; 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(Player::Id::PLAYER1) - 1); players_.emplace_back(std::make_unique(config_player1)); @@ -554,7 +557,7 @@ void Title::initPlayers() { config_player2.demo = DEMO; config_player2.play_area = ¶m.game.play_area.rect; 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(Player::Id::PLAYER2) - 1); players_.emplace_back(std::make_unique(config_player2));