forked from jaildesigner-jailgames/jaildoctors_dilemma
Cuendo el jugador entra a la Jail, recupera todas sus vidas
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user