forked from jaildesigner-jailgames/jaildoctors_dilemma
Cuendo el jugador entra a la Jail, recupera todas sus vidas
This commit is contained in:
@@ -37,8 +37,6 @@ void Notify::render()
|
|||||||
{
|
{
|
||||||
notifications.at(i).sprite->render();
|
notifications.at(i).sprite->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
text->write(8,8,"TEXTO DE PRUEBA");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza el estado de las notificaiones
|
// Actualiza el estado de las notificaiones
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Director::Director(int argc, char *argv[])
|
|||||||
music = JA_LoadMusic(asset->get("title.ogg").c_str());
|
music = JA_LoadMusic(asset->get("title.ogg").c_str());
|
||||||
|
|
||||||
// Inicializa los servicios online
|
// Inicializa los servicios online
|
||||||
initOnline();
|
//initOnline();
|
||||||
}
|
}
|
||||||
|
|
||||||
Director::~Director()
|
Director::~Director()
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ void Game::update()
|
|||||||
checkIfPlayerIsAlive();
|
checkIfPlayerIsAlive();
|
||||||
checkGameOver();
|
checkGameOver();
|
||||||
checkEndGame();
|
checkEndGame();
|
||||||
|
checkRestoringJail();
|
||||||
scoreboard->update();
|
scoreboard->update();
|
||||||
input->update();
|
input->update();
|
||||||
|
|
||||||
@@ -600,4 +601,22 @@ void Game::switchPause()
|
|||||||
scoreboard->pause();
|
scoreboard->pause();
|
||||||
paused = true;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -127,6 +127,9 @@ private:
|
|||||||
// Pone el juego en pausa
|
// Pone el juego en pausa
|
||||||
void switchPause();
|
void switchPause();
|
||||||
|
|
||||||
|
// Da vidas al jugador cuando está en la Jail
|
||||||
|
void checkRestoringJail();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, Input *input, Debug *debug);
|
Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, Input *input, Debug *debug);
|
||||||
|
|||||||
Reference in New Issue
Block a user