diff --git a/config/assets.yaml b/config/assets.yaml index e5fc17d..b858c04 100644 --- a/config/assets.yaml +++ b/config/assets.yaml @@ -69,14 +69,6 @@ assets: path: ${PREFIX}/data/player/player.gif - type: ANIMATION path: ${PREFIX}/data/player/player.yaml - - type: BITMAP - path: ${PREFIX}/data/player/player2.gif - - type: ANIMATION - path: ${PREFIX}/data/player/player2.yaml - - type: BITMAP - path: ${PREFIX}/data/player/player_game_over.gif - - type: ANIMATION - path: ${PREFIX}/data/player/player_game_over.yaml # MUSIC music: @@ -84,16 +76,6 @@ assets: path: ${PREFIX}/data/music/574070_KUVO_Farewell_to_school.ogg - type: MUSIC path: ${PREFIX}/data/music/574071_EA_DTV.ogg - - type: MUSIC - path: ${PREFIX}/data/music/574072_Scalesmann_Kaleidoscope.ogg - - type: MUSIC - path: ${PREFIX}/data/music/574073_KUVO_We_are_us.ogg - - type: MUSIC - path: ${PREFIX}/data/music/574219_nq_core_vet.ogg - - type: MUSIC - path: ${PREFIX}/data/music/575111_nq_Zak_McDrucken.ogg - - type: MUSIC - path: ${PREFIX}/data/music/576109_Pator_Parallel_Visions.ogg # SOUNDS sounds: diff --git a/data/music/574072_Scalesmann_Kaleidoscope.ogg b/data/music/574072_Scalesmann_Kaleidoscope.ogg deleted file mode 100644 index e5f5716..0000000 Binary files a/data/music/574072_Scalesmann_Kaleidoscope.ogg and /dev/null differ diff --git a/data/music/574073_KUVO_We_are_us.ogg b/data/music/574073_KUVO_We_are_us.ogg deleted file mode 100644 index d806bcd..0000000 Binary files a/data/music/574073_KUVO_We_are_us.ogg and /dev/null differ diff --git a/data/music/574219_nq_core_vet.ogg b/data/music/574219_nq_core_vet.ogg deleted file mode 100644 index 194d9ed..0000000 Binary files a/data/music/574219_nq_core_vet.ogg and /dev/null differ diff --git a/data/music/575111_nq_Zak_McDrucken.ogg b/data/music/575111_nq_Zak_McDrucken.ogg deleted file mode 100644 index 31183fc..0000000 Binary files a/data/music/575111_nq_Zak_McDrucken.ogg and /dev/null differ diff --git a/data/music/576109_Pator_Parallel_Visions.ogg b/data/music/576109_Pator_Parallel_Visions.ogg deleted file mode 100644 index 88192c6..0000000 Binary files a/data/music/576109_Pator_Parallel_Visions.ogg and /dev/null differ diff --git a/data/player/player2.gif b/data/player/player2.gif deleted file mode 100644 index 4140a75..0000000 Binary files a/data/player/player2.gif and /dev/null differ diff --git a/data/player/player2.yaml b/data/player/player2.yaml deleted file mode 100644 index 395ab89..0000000 --- a/data/player/player2.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# player2 animation -tileSetFile: player2.gif -frameWidth: 8 -frameHeight: 16 - -animations: - - name: stand - speed: 0.1333 - loop: 0 - frames: [0] - - - name: walk - speed: 0.1333 - loop: 0 - frames: [0, 1, 2, 3, 4, 5, 6, 7] - - - name: walk_menu - speed: 0.0 - loop: 0 - frames: [0, 1, 2, 3, 4, 5, 6, 7] diff --git a/data/player/player_game_over.gif b/data/player/player_game_over.gif deleted file mode 100644 index b48c4f8..0000000 Binary files a/data/player/player_game_over.gif and /dev/null differ diff --git a/data/player/player_game_over.yaml b/data/player/player_game_over.yaml deleted file mode 100644 index 2aa1b2d..0000000 --- a/data/player/player_game_over.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# player_game_over animation -tileSetFile: player_game_over.gif -frameWidth: 19 -frameHeight: 18 - -animations: - - name: default - speed: 0.1 - loop: 0 - frames: [0, 1, 2, 3] diff --git a/source/game/scenes/game.cpp b/source/game/scenes/game.cpp index 66328ab..71b2c50 100644 --- a/source/game/scenes/game.cpp +++ b/source/game/scenes/game.cpp @@ -42,7 +42,7 @@ Game::Game(Mode mode) spawn_data_(Player::SpawnData(25 * Tile::SIZE, 21 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT)) #else current_room_("03.yaml"), - spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT)) + spawn_data_(Player::SpawnData(25 * Tile::SIZE, 21 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT)) #endif { // Crea objetos e inicializa variables @@ -173,12 +173,12 @@ void Game::updatePlaying(float delta_time) { #else player_->update(delta_time); #endif - checkPlayerIsOnBorder(); - checkPlayerAndItems(); - checkPlayerAndEnemies(); - checkIfPlayerIsAlive(); - checkEndGame(); - checkRestoringJail(delta_time); + handlePlayerIsOnBorder(); + handlePlayerAndItemsCollisions(); + handlePlayerAndEnemiesCollisions(); + handleIfPlayerIsAlive(); + isGameCompleted(); + restAtJail(delta_time); break; case Mode::DEMO: @@ -581,7 +581,7 @@ auto Game::changeRoom(const std::string& room_path) -> bool { } // Comprueba si el jugador esta en el borde de la pantalla -void Game::checkPlayerIsOnBorder() { +void Game::handlePlayerIsOnBorder() { if (player_->isOnBorder()) { const auto BORDER = player_->getBorder(); const auto ROOM_NAME = room_->getRoom(BORDER); @@ -602,7 +602,7 @@ void Game::checkPlayerIsOnBorder() { } // Comprueba las colisiones del jugador con los enemigos -auto Game::checkPlayerAndEnemies() -> bool { +auto Game::handlePlayerAndEnemiesCollisions() -> bool { const bool DEATH = room_->enemyCollision(player_->getCollider()); if (DEATH) { killPlayer(); @@ -611,12 +611,12 @@ auto Game::checkPlayerAndEnemies() -> bool { } // Comprueba las colisiones del jugador con los objetos -void Game::checkPlayerAndItems() { +void Game::handlePlayerAndItemsCollisions() { room_->itemCollision(player_->getCollider()); } // Comprueba si el jugador esta vivo -void Game::checkIfPlayerIsAlive() { +void Game::handleIfPlayerIsAlive() { if (!player_->isAlive()) { killPlayer(); } @@ -652,7 +652,7 @@ void Game::setScoreBoardColor() { } // Comprueba si ha finalizado el juego -auto Game::checkEndGame() -> bool { +auto Game::isGameCompleted() -> bool { const bool IS_ON_THE_ROOM = room_->getName() == "THE JAIL"; // Estar en la habitación que toca const bool HAVE_THE_ITEMS = scoreboard_data_->items >= int(total_items_ * 0.9F) || Options::cheats.jail_is_open == Options::Cheat::State::ENABLED; // Con mas del 90% de los items recogidos const bool IS_ON_THE_DOOR = player_->getRect().x <= 128; // Y en la ubicación que toca (En la puerta) @@ -691,7 +691,7 @@ void Game::togglePause() { } // Da vidas al jugador cuando está en la Jail -void Game::checkRestoringJail(float delta_time) { +void Game::restAtJail(float delta_time) { if (room_->getName() != "THE JAIL" || scoreboard_data_->lives == 9) { jail_restore_time_ = 0.0F; // Reset timer cuando no está en la Jail return; @@ -728,8 +728,7 @@ void Game::fillRoomNameTexture() { // Inicializa al jugador void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr room) { - std::string player_animations = Options::cheats.alternate_skin == Options::Cheat::State::ENABLED ? "player2.yaml" : "player.yaml"; - const Player::Data PLAYER{.spawn_data = spawn_point, .animations_path = player_animations, .room = std::move(room)}; + const Player::Data PLAYER{.spawn_data = spawn_point, .animations_path = "player.yalm", .room = std::move(room)}; player_ = std::make_shared(PLAYER); } diff --git a/source/game/scenes/game.hpp b/source/game/scenes/game.hpp index a701f56..111f948 100644 --- a/source/game/scenes/game.hpp +++ b/source/game/scenes/game.hpp @@ -71,16 +71,16 @@ class Game { void renderPostFadeEnding(); // Renderiza el juego en estado POST_FADE_ENDING (pantalla negra) auto changeRoom(const std::string& room_path) -> bool; // Cambia de habitación void handleInput(); // Comprueba el teclado - void checkPlayerIsOnBorder(); // Comprueba si el jugador esta en el borde de la pantalla y actua - auto checkPlayerAndEnemies() -> bool; // Comprueba las colisiones del jugador con los enemigos - void checkPlayerAndItems(); // Comprueba las colisiones del jugador con los objetos - void checkIfPlayerIsAlive(); // Comprueba si el jugador esta vivo + void handlePlayerIsOnBorder(); // Comprueba si el jugador esta en el borde de la pantalla y actua + auto handlePlayerAndEnemiesCollisions() -> bool; // Comprueba las colisiones del jugador con los enemigos + void handlePlayerAndItemsCollisions(); // Comprueba las colisiones del jugador con los objetos + void handleIfPlayerIsAlive(); // Comprueba si el jugador esta vivo void killPlayer(); // Mata al jugador void setScoreBoardColor(); // Pone el color del marcador en función del color del borde de la habitación - auto checkEndGame() -> bool; // Comprueba si ha finalizado el juego + auto isGameCompleted() -> bool; // Comprueba si ha finalizado el juego static auto getTotalItems() -> int; // Obtiene la cantidad total de items que hay en el mapeado del juego void togglePause(); // Pone el juego en pausa - void checkRestoringJail(float delta_time); // Da vidas al jugador cuando está en la Jail + void restAtJail(float delta_time); // Da vidas al jugador cuando está en la Jail void fillRoomNameTexture(); // Pone el nombre de la habitación en la textura void checkSomeCheevos(); // Comprueba algunos logros void checkEndGameCheevos(); // Comprueba los logros de completar el juego