1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-15 19:33:36 +00:00

freeplay stuff in progress

This commit is contained in:
Cameron Taylor 2021-03-02 00:46:28 -05:00
parent 217ad5cc81
commit 1a6b2e51a7

View file

@ -7,6 +7,7 @@ import flixel.addons.display.FlxGridOverlay;
import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.math.FlxMath; import flixel.math.FlxMath;
import flixel.text.FlxText; import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor; import flixel.util.FlxColor;
import lime.utils.Assets; import lime.utils.Assets;
@ -25,10 +26,13 @@ class FreeplayState extends MusicBeatState
var lerpScore:Int = 0; var lerpScore:Int = 0;
var intendedScore:Int = 0; var intendedScore:Int = 0;
var coolColors:Array<Int> = [0xff223344, 0xff123456, 0xFFFFFFFF, 0xFFADAD];
private var grpSongs:FlxTypedGroup<Alphabet>; private var grpSongs:FlxTypedGroup<Alphabet>;
private var curPlaying:Bool = false; private var curPlaying:Bool = false;
private var iconArray:Array<HealthIcon> = []; private var iconArray:Array<HealthIcon> = [];
var bg:FlxSprite;
override function create() override function create()
{ {
@ -75,7 +79,7 @@ class FreeplayState extends MusicBeatState
// LOAD CHARACTERS // LOAD CHARACTERS
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuBGBlue')); bg = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
add(bg); add(bg);
grpSongs = new FlxTypedGroup<Alphabet>(); grpSongs = new FlxTypedGroup<Alphabet>();
@ -105,7 +109,7 @@ class FreeplayState extends MusicBeatState
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT); scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
// scoreText.alignment = RIGHT; // scoreText.alignment = RIGHT;
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000); var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.3), 66, 0xFF000000);
scoreBG.alpha = 0.6; scoreBG.alpha = 0.6;
add(scoreBG); add(scoreBG);
@ -178,6 +182,7 @@ class FreeplayState extends MusicBeatState
} }
lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4)); lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4));
bg.color = FlxColor.interpolate(bg.color, coolColors[curSelected % coolColors.length], 0.045);
if (Math.abs(lerpScore - intendedScore) <= 10) if (Math.abs(lerpScore - intendedScore) <= 10)
lerpScore = intendedScore; lerpScore = intendedScore;
@ -236,15 +241,11 @@ class FreeplayState extends MusicBeatState
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty); intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
#end #end
switch (curDifficulty) PlayState.storyDifficulty = curDifficulty;
{
case 0: diffText.text = "< " + CoolUtil.difficultyString() + " >";
diffText.text = "EASY"; diffText.x = FlxG.width * 0.85;
case 1: diffText.x -= (diffText.width / 2);
diffText.text = 'NORMAL';
case 2:
diffText.text = "HARD";
}
} }
function changeSelection(change:Int = 0) function changeSelection(change:Int = 0)