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();
|
||||
}
|
||||
|
||||
text->write(8,8,"TEXTO DE PRUEBA");
|
||||
}
|
||||
|
||||
// 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());
|
||||
|
||||
// Inicializa los servicios online
|
||||
initOnline();
|
||||
//initOnline();
|
||||
}
|
||||
|
||||
Director::~Director()
|
||||
|
||||
@@ -232,6 +232,7 @@ void Game::update()
|
||||
checkIfPlayerIsAlive();
|
||||
checkGameOver();
|
||||
checkEndGame();
|
||||
checkRestoringJail();
|
||||
scoreboard->update();
|
||||
input->update();
|
||||
|
||||
@@ -601,3 +602,21 @@ void Game::switchPause()
|
||||
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
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user