mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user