Fix a bug where the background of the game over screen is pink

This commit is contained in:
EliteMasterEric 2023-12-19 01:57:39 -05:00
parent f16f2b8f84
commit 8fea7eb734
2 changed files with 17 additions and 4 deletions

View file

@ -64,9 +64,13 @@ class GameOverSubState extends MusicBeatSubState
*/
var isEnding:Bool = false;
public function new()
var transparent:Bool;
public function new(params:GameOverParams)
{
super();
transparent = params.transparent;
}
/**
@ -87,9 +91,10 @@ class GameOverSubState extends MusicBeatSubState
//
// Add a black background to the screen.
// We make this transparent so that we can see the stage underneath during debugging.
var bg = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
bg.alpha = 0.25;
// We make this transparent so that we can see the stage underneath during debugging,
// but it's normally opaque.
bg.alpha = transparent ? 0.25 : 1.0;
bg.scrollFactor.set();
add(bg);
@ -307,3 +312,8 @@ class GameOverSubState extends MusicBeatSubState
});
}
}
typedef GameOverParams =
{
var transparent:Bool;
}

View file

@ -922,7 +922,10 @@ class PlayState extends MusicBeatSubState
}
#end
var gameOverSubState = new GameOverSubState();
var gameOverSubState = new GameOverSubState(
{
transparent: persistentDraw,
});
FlxTransitionableSubState.skipNextTransIn = true;
FlxTransitionableSubState.skipNextTransOut = true;
openSubState(gameOverSubState);