Skip to content

Commit

Permalink
domain expansion: taco bell aftermath
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Jun 7, 2024
1 parent 490f171 commit 7c03f57
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion source/meta/state/MinigamesState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MinigamesState extends MusicBeatState
var controlStrings:Array<Minigame> = [
new Minigame('GET OUT OF MY HEAD', 'the pain never stops\n(Amogus)', 'mgicons/sus'),
new Minigame('.jpegs are funny', "they are and you can't tell me otherwise\n(Compression)", 'mgicons/pico'),
new Minigame('Kill BF', 'lmao', 'mgicons/killBf')
new Minigame('Kill BF', 'lmao\n(Point & Click)', 'mgicons/killBf')
// soon...
// new Minigame("Joalor64's Special", 'It\'s me!\n(Melodic Circuit)', 'mgicons/me')
];
Expand Down
2 changes: 1 addition & 1 deletion source/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ class PlayState extends MusicBeatState
iconP2.canBounce = true;
add(iconP2);

scoreTxt = new FlxText(0, healthBar.y + 40, FlxG.width, "", 20);
scoreTxt = new FlxText(0, healthBar.y + 36, FlxG.width, "", 20);
scoreTxt.setFormat(Paths.font("vcr.ttf"), 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
scoreTxt.scrollFactor.set();
scoreTxt.borderSize = 1.25;
Expand Down
5 changes: 3 additions & 2 deletions source/meta/state/ReplaySelectState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ class ReplaySelectState extends MusicBeatState

else if (controls.ACCEPT && menuItems.length > 0)
{
FreeplayState.curPlaying = false;
FreeplayState.destroyFreeplayVocals();
PlayState.SONG = Song.loadFromJson(song, songName);
PlayState.storyDifficulty = difficulties[curSelected];
LoadingState.loadAndSwitchState(new ReplayState(Std.parseInt(menuItems[curSelected].split(" ")[1])), true);
}

else if (controls.BACK)
MusicBeatState.switchState(new FreeplayState());

Expand Down Expand Up @@ -183,4 +184,4 @@ class ReplaySelectState extends MusicBeatState
}
}
}
}
}
15 changes: 11 additions & 4 deletions source/objects/userinterface/Bar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Bar extends FlxSpriteGroup
public var leftBar:FlxSprite;
public var rightBar:FlxSprite;
public var bg:FlxSprite;
public var valueFunction:Void->Float = function() return 0;
public var valueFunction:Void->Float = null;
public var percent(default, set):Float = 0;
public var bounds:Dynamic = {min: 0, max: 1};
public var leftToRight(default, set):Bool = true;
Expand All @@ -19,7 +19,7 @@ class Bar extends FlxSpriteGroup
{
super(x, y);

if (valueFunction != null) this.valueFunction = valueFunction;
this.valueFunction = valueFunction;
setBounds(boundX, boundY);

bg = new FlxSprite().loadGraphic(Paths.image(image));
Expand All @@ -42,13 +42,20 @@ class Bar extends FlxSpriteGroup

public var enabled:Bool = true;
override function update(elapsed:Float) {
var value:Null<Float> = FlxMath.remapToRange(FlxMath.bound(valueFunction(), bounds.min, bounds.max), bounds.min, bounds.max, 0, 100);
percent = (value != null ? value : 0);
if (!enabled)
{
super.update(elapsed);
return;
}

if (valueFunction != null)
{
var value:Null<Float> = FlxMath.remapToRange(FlxMath.bound(valueFunction(), bounds.min, bounds.max), bounds.min, bounds.max, 0, 100);
percent = (value != null ? value : 0);
}
else percent = 0;

super.update(elapsed);
}

public function setBounds(min:Float, max:Float)
Expand Down

0 comments on commit 7c03f57

Please sign in to comment.