From d51fffd6d1ecc30807e992836d43f9f9ad7e4cfd Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 7 Dec 2021 17:41:18 -0500 Subject: [PATCH] difficulty stuff lol! --- source/FreeplayState.hx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 0cfbadb8c..5f73627e5 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -9,6 +9,7 @@ import flixel.addons.display.FlxGridOverlay; import flixel.addons.transition.FlxTransitionableState; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxGroup; +import flixel.group.FlxSpriteGroup; import flixel.input.touch.FlxTouch; import flixel.math.FlxAngle; import flixel.math.FlxMath; @@ -44,6 +45,8 @@ class FreeplayState extends MusicBeatSubstate var lerpScore:Float = 0; var intendedScore:Int = 0; + var grpDifficulties:FlxSpriteGroup; + var coolColors:Array = [ 0xff9271fd, 0xff9271fd, @@ -197,6 +200,22 @@ class FreeplayState extends MusicBeatSubstate grpCapsules = new FlxTypedGroup(); add(grpCapsules); + grpDifficulties = new FlxSpriteGroup(-300, 100); + add(grpDifficulties); + + grpDifficulties.add(new FlxSprite().loadGraphic(Paths.image('freeplay/freeplayEasy'))); + grpDifficulties.add(new FlxSprite().loadGraphic(Paths.image('freeplay/freeplayNorm'))); + grpDifficulties.add(new FlxSprite().loadGraphic(Paths.image('freeplay/freeplayHard'))); + + grpDifficulties.group.forEach(function(spr) + { + spr.visible = false; + }); + + grpDifficulties.group.members[curDifficulty].visible = true; + + FlxTween.tween(grpDifficulties, {x: 50}, 0.6, {ease: FlxEase.quartOut, startDelay: 0.1}); + var overhangStuff:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, 64, FlxColor.BLACK); overhangStuff.y -= overhangStuff.height; add(overhangStuff); @@ -584,6 +603,14 @@ class FreeplayState extends MusicBeatSubstate PlayState.storyDifficulty = curDifficulty; diffText.text = "< " + CoolUtil.difficultyString() + " >"; + + grpDifficulties.group.forEach(function(spr) + { + spr.visible = false; + }); + + grpDifficulties.group.members[curDifficulty].visible = true; + positionHighscore(); }