Añadido efecto de atenuación a la clase screen

Al pausar el juego se atenua la pantalla
This commit is contained in:
2024-06-30 15:27:06 +02:00
parent addc8241ab
commit 8340bdfe32
4 changed files with 44 additions and 4 deletions

View File

@@ -2744,7 +2744,7 @@ void Game::checkGameInput()
else if (input->checkInput(input_pause, REPEAT_FALSE))
{
paused = !paused;
pause(!paused);
}
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
@@ -3241,12 +3241,12 @@ void Game::checkEvents()
{
if (eventHandler->window.event == SDL_WINDOWEVENT_FOCUS_LOST)
{
paused = true;
pause(true);
}
if (eventHandler->window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
{
paused = false;
pause(false);
}
}
}
@@ -3352,4 +3352,11 @@ void Game::updateScoreboard()
scoreboard->setPower((float)stage[currentStage].currentPower / (float)stage[currentStage].powerToComplete);
scoreboard->setHiScore(hiScore);
scoreboard->setHiScoreName(hiScoreName);
}
// Pausa el juego
void Game::pause(bool value)
{
paused = value;
screen->attenuate(paused);
}