Skip to content

Commit

Permalink
character specific pause music support
Browse files Browse the repository at this point in the history
  • Loading branch information
Vortex2Oblivion committed Nov 3, 2024
1 parent fb0b472 commit 97399cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Binary file not shown.
13 changes: 10 additions & 3 deletions source/substates/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import openfl.utils.Assets;
import ui.Option;

using StringTools;
Expand All @@ -32,7 +33,10 @@ class PauseSubState extends MusicBeatSubstate {

var menu:String = "default";

var pauseMusic:FlxSound = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
var pauseMusic:FlxSound = new FlxSound().loadEmbedded(Paths.music('breakfast'
+ (Assets.exists(Paths.music('breakfast-' + PlayState.boyfriend.curCharacter, 'shared')) ? '-' + PlayState.boyfriend.curCharacter : ''),
'shared'),
true, true);

var pauseCamera:FlxCamera = new FlxCamera();

Expand Down Expand Up @@ -95,9 +99,12 @@ class PauseSubState extends MusicBeatSubstate {

var holdTime:Float = 0;

public var MAX_MUSIC_VOLUME:Float = 0.5;
public var MUSIC_INCREASE_SPEED:Float = 0.02;

override function update(elapsed:Float) {
if (pauseMusic.volume < 0.5)
pauseMusic.volume += 0.01 * elapsed;
if (pauseMusic.volume < MAX_MUSIC_VOLUME)
pauseMusic.volume += MUSIC_INCREASE_SPEED * elapsed;

super.update(elapsed);

Expand Down

0 comments on commit 97399cf

Please sign in to comment.