forked from jaildesigner-jailgames/jaildoctors_dilemma
La partida ya termina al quedarse sin vidas
This commit is contained in:
@@ -192,6 +192,7 @@ void Game::update()
|
||||
checkPlayerAndItems();
|
||||
checkPlayerAndEnemies();
|
||||
checkIfPlayerIsAlive();
|
||||
checkEndGame();
|
||||
scoreboard->update();
|
||||
updateDebugInfo();
|
||||
}
|
||||
@@ -343,6 +344,15 @@ void Game::checkIfPlayerIsAlive()
|
||||
}
|
||||
}
|
||||
|
||||
// Comprueba si ha terminado la partida
|
||||
void Game::checkEndGame()
|
||||
{
|
||||
if (board.lives < 0)
|
||||
{
|
||||
section.name = SECTION_PROG_TITLE;
|
||||
}
|
||||
}
|
||||
|
||||
// Mata al jugador
|
||||
void Game::killPlayer()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user