De-duplicate screen effects timer decrementing

The code to decrement the timers for flashing and shaking is now handled
outside the game-gamestate case-switch, instead of having to be
duplicated inside each render function.

As a bonus, I made it so the timer decrements even if screen effects are
disabled. This is to prevent any theoretical situation where the timer
can "pile up" due to disabled screen effects not letting it tick down.
This commit is contained in:
Misa
2020-04-26 18:33:07 -07:00
committed by Ethan Lee
parent b26e94b919
commit 0e082551b1
4 changed files with 10 additions and 16 deletions

View File

@@ -97,13 +97,11 @@ void preloaderrender()
if (game.flashlight > 0 && !game.noflashingmode)
{
game.flashlight--;
graphics.flashlight();
}
if (game.screenshake > 0 && !game.noflashingmode)
{
game.screenshake--;
graphics.screenshake();
}
else