Nuevo: deshabilita input por un periodo de tiempo

This commit is contained in:
2022-11-02 18:04:32 +01:00
parent 5302e16064
commit bb992b7d90
7 changed files with 59 additions and 4 deletions

View File

@@ -214,6 +214,7 @@ void Game::update()
checkIfPlayerIsAlive();
checkEndGame();
scoreboard->update();
input->update();
updateDebugInfo();
updateBlackScreen();
@@ -400,6 +401,7 @@ void Game::killPlayer()
// Sonido
JA_PlaySound(deathSound);
// Pone la pantalla en negro un tiempo
setBlackScreen();
// Crea la nueva habitación y el nuevo jugador
@@ -407,8 +409,12 @@ void Game::killPlayer()
const player_t player = {spawnPoint, "player.png", "player.ani", renderer, resource, asset, options, input, room, debug};
this->player = new Player(player);
// Pone los objetos en pausa mientras esta la habitación en negro
room->pause();
this->player->pause();
// Deshabilita las entradas hasta que no haya ninguna activa
input->disableUntil(d_keyPressed);
}
// Recarga todas las texturas