2020-12-24 18:24:11 -05:00
|
|
|
package;
|
|
|
|
|
|
|
|
import flixel.FlxSprite;
|
|
|
|
|
|
|
|
class HealthIcon extends FlxSprite
|
|
|
|
{
|
2021-03-01 18:59:51 -05:00
|
|
|
/**
|
|
|
|
* Used for FreeplayState! If you use it elsewhere, prob gonna annoying
|
|
|
|
*/
|
|
|
|
public var sprTracker:FlxSprite;
|
|
|
|
|
2020-12-24 18:24:11 -05:00
|
|
|
public function new(char:String = 'bf', isPlayer:Bool = false)
|
|
|
|
{
|
|
|
|
super();
|
2021-02-08 16:34:48 -05:00
|
|
|
loadGraphic(Paths.image('iconGrid'), true, 150, 150);
|
2020-12-24 18:24:11 -05:00
|
|
|
|
|
|
|
antialiasing = true;
|
|
|
|
animation.add('bf', [0, 1], 0, false, isPlayer);
|
2021-01-14 23:33:12 -05:00
|
|
|
animation.add('bf-car', [0, 1], 0, false, isPlayer);
|
2021-01-19 21:44:09 -05:00
|
|
|
animation.add('bf-christmas', [0, 1], 0, false, isPlayer);
|
2021-01-31 21:43:09 -05:00
|
|
|
animation.add('bf-pixel', [21, 21], 0, false, isPlayer);
|
2020-12-24 18:24:11 -05:00
|
|
|
animation.add('spooky', [2, 3], 0, false, isPlayer);
|
|
|
|
animation.add('pico', [4, 5], 0, false, isPlayer);
|
2021-03-13 20:53:57 -05:00
|
|
|
animation.add('pico-speaker', [4, 5], 0, false, isPlayer);
|
2020-12-24 18:24:11 -05:00
|
|
|
animation.add('mom', [6, 7], 0, false, isPlayer);
|
2021-01-14 23:33:12 -05:00
|
|
|
animation.add('mom-car', [6, 7], 0, false, isPlayer);
|
2020-12-24 18:24:11 -05:00
|
|
|
animation.add('tankman', [8, 9], 0, false, isPlayer);
|
|
|
|
animation.add('face', [10, 11], 0, false, isPlayer);
|
|
|
|
animation.add('dad', [12, 13], 0, false, isPlayer);
|
2021-01-31 21:43:09 -05:00
|
|
|
animation.add('senpai', [22, 22], 0, false, isPlayer);
|
2021-02-02 03:24:34 -05:00
|
|
|
animation.add('senpai-angry', [22, 22], 0, false, isPlayer);
|
2021-02-02 00:48:22 -05:00
|
|
|
animation.add('spirit', [23, 23], 0, false, isPlayer);
|
2020-12-24 18:24:11 -05:00
|
|
|
animation.add('bf-old', [14, 15], 0, false, isPlayer);
|
2020-12-27 03:13:51 -05:00
|
|
|
animation.add('gf', [16], 0, false, isPlayer);
|
2021-01-20 01:38:39 -05:00
|
|
|
animation.add('parents-christmas', [17], 0, false, isPlayer);
|
|
|
|
animation.add('monster', [19, 20], 0, false, isPlayer);
|
|
|
|
animation.add('monster-christmas', [19, 20], 0, false, isPlayer);
|
2020-12-24 18:24:11 -05:00
|
|
|
animation.play(char);
|
|
|
|
scrollFactor.set();
|
|
|
|
}
|
2021-03-01 18:59:51 -05:00
|
|
|
|
|
|
|
override function update(elapsed:Float)
|
|
|
|
{
|
|
|
|
super.update(elapsed);
|
|
|
|
|
|
|
|
if (sprTracker != null)
|
|
|
|
setPosition(sprTracker.x + sprTracker.width + 10, sprTracker.y - 30);
|
|
|
|
}
|
2020-12-24 18:24:11 -05:00
|
|
|
}
|