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

@ -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);
}
}