freeplay menu polish thingie

This commit is contained in:
Cameron Taylor 2021-03-01 18:59:51 -05:00
parent bc22d564f6
commit 5632736ed4
4 changed files with 23 additions and 5 deletions

View File

@ -1,4 +1 @@
Tutorial
Bopeebo
Fresh
Dadbattle
Tutorial

View File

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -34,7 +34,7 @@ class FreeplayState extends MusicBeatState
for (i in 0...initSonglist.length)
{
songs.push(new SongMetadata(initSonglist[i], 1, 'dad'));
songs.push(new SongMetadata(initSonglist[i], 1, 'gf'));
}
/*
@ -51,6 +51,9 @@ class FreeplayState extends MusicBeatState
isDebug = true;
#end
if (StoryMenuState.weekUnlocked[2] || isDebug)
addWeek(['Bopeebo', 'Fresh', 'Dadbattle'], 1, ['dad']);
if (StoryMenuState.weekUnlocked[2] || isDebug)
addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky']);
@ -82,6 +85,11 @@ class FreeplayState extends MusicBeatState
songText.isMenuItem = true;
songText.targetY = i;
grpSongs.add(songText);
var icon:HealthIcon = new HealthIcon(songs[i].songCharacter);
icon.sprTracker = songText;
add(icon);
// songText.x += 40;
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
// songText.screenCenter(X);

View File

@ -4,6 +4,11 @@ import flixel.FlxSprite;
class HealthIcon extends FlxSprite
{
/**
* Used for FreeplayState! If you use it elsewhere, prob gonna annoying
*/
public var sprTracker:FlxSprite;
public function new(char:String = 'bf', isPlayer:Bool = false)
{
super();
@ -32,4 +37,12 @@ class HealthIcon extends FlxSprite
animation.play(char);
scrollFactor.set();
}
override function update(elapsed:Float)
{
super.update(elapsed);
if (sprTracker != null)
setPosition(sprTracker.x + sprTracker.width + 10, sprTracker.y - 30);
}
}