diff --git a/source/common/notify.cpp b/source/common/notify.cpp index 406ad48..a60b3af 100644 --- a/source/common/notify.cpp +++ b/source/common/notify.cpp @@ -37,8 +37,6 @@ void Notify::render() { notifications.at(i).sprite->render(); } - - text->write(8,8,"TEXTO DE PRUEBA"); } // Actualiza el estado de las notificaiones diff --git a/source/director.cpp b/source/director.cpp index e1aa238..5245a38 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -59,7 +59,7 @@ Director::Director(int argc, char *argv[]) music = JA_LoadMusic(asset->get("title.ogg").c_str()); // Inicializa los servicios online - initOnline(); + //initOnline(); } Director::~Director() diff --git a/source/game.cpp b/source/game.cpp index 709ac9f..beb7ee3 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -232,6 +232,7 @@ void Game::update() checkIfPlayerIsAlive(); checkGameOver(); checkEndGame(); + checkRestoringJail(); scoreboard->update(); input->update(); @@ -600,4 +601,22 @@ void Game::switchPause() scoreboard->pause(); paused = true; } +} + +// Da vidas al jugador cuando está en la Jail +void Game::checkRestoringJail() +{ + if (room->getName() != "THE JAIL" || board.lives == 9) + { + return; + } + + static int counter = 0; + counter++; + if (counter == 100) + { + counter = 0; + board.lives++; + JA_PlaySound(deathSound); + } } \ No newline at end of file diff --git a/source/game.h b/source/game.h index 77b3a00..62e1bc9 100644 --- a/source/game.h +++ b/source/game.h @@ -127,6 +127,9 @@ private: // Pone el juego en pausa void switchPause(); + // Da vidas al jugador cuando está en la Jail + void checkRestoringJail(); + public: // Constructor Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, Input *input, Debug *debug);