diff --git a/preload/scripts/stages/phillyTrainErect.hxc b/preload/scripts/stages/phillyTrainErect.hxc index 7b2ace93..faaa841e 100644 --- a/preload/scripts/stages/phillyTrainErect.hxc +++ b/preload/scripts/stages/phillyTrainErect.hxc @@ -307,7 +307,7 @@ class PhillyTrainErectStage extends Stage // NOTE: You pass the constructor variables directly, not as an array. lightShader = ScriptedFlxRuntimeShader.init('BuildingEffectShader', 1.0); - trainSound = new FlxSound().loadEmbedded(Paths.sound('train_passes')); + trainSound = FunkinSound.load(Paths.sound('train_passes')); colorShader = new AdjustColorShader(); FlxG.sound.list.add(trainSound); @@ -418,6 +418,20 @@ class PhillyTrainErectStage extends Stage } } + public override function onPause(event:PauseScriptEvent) { + super.onPause(event); + + // Temporarily stop ambiance. + if (trainSound != null) trainSound.pause(); + } + + public override function onResume(event:ScriptEvent) { + super.onResume(event); + + // Temporarily stop ambiance. + if (trainSound != null) trainSound.resume(); + } + function trainStart():Void { trainMoving = true;