This commit is contained in:
⍚~Nex
2024-09-01 02:13:00 +02:00
parent 4b783a983e
commit 7fb464d81b
+3 -1
View File
@@ -28,6 +28,7 @@ class GameOverSubstate extends MusicBeatSubstate
public var gameoverScript:Script;
public var game:PlayState = PlayState.instance; // shortcut
public static var instance:GameOverSubstate = null;
private var __cancelDefault:Bool = false;
@@ -56,7 +57,7 @@ class GameOverSubstate extends MusicBeatSubstate
FlxG.sound.music.stop();
gameoverScript = Script.create(Paths.script(script));
gameoverScript.setParent(this);
gameoverScript.setParent(instance = this);
gameoverScript.load();
var event = EventManager.get(GameOverCreationEvent).recycle(x, y, characterName, player, gameOverSong, gameOverSongBPM, lossSFXName, retrySFX);
@@ -198,5 +199,6 @@ class GameOverSubstate extends MusicBeatSubstate
gameoverScript.destroy();
super.destroy();
instance = null;
}
}