Funkin/source/Boyfriend.hx

44 lines
825 B
Haxe
Raw Normal View History

2020-10-04 14:50:12 -04:00
package;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
2020-11-10 22:09:48 -05:00
import flixel.util.FlxTimer;
2020-10-04 14:50:12 -04:00
2020-10-04 23:29:35 -04:00
using StringTools;
2020-10-04 18:27:49 -04:00
class Boyfriend extends Character
2020-10-04 14:50:12 -04:00
{
// public var stunned:Bool = false;
2021-01-13 22:38:31 -05:00
public function new(x:Float, y:Float, ?char:String = 'bf')
2020-10-04 14:50:12 -04:00
{
2021-01-13 22:38:31 -05:00
super(x, y, char, true);
2020-10-04 17:44:52 -04:00
}
2020-10-04 23:29:35 -04:00
2021-03-18 14:15:54 -04:00
public var startedDeath:Bool = false;
2020-10-04 23:29:35 -04:00
override function update(elapsed:Float)
{
2021-01-14 23:33:12 -05:00
if (!debugMode)
2020-11-10 22:09:48 -05:00
{
2021-01-14 23:33:12 -05:00
if (animation.curAnim.name.startsWith('sing'))
{
holdTimer += elapsed;
}
else
holdTimer = 0;
if (animation.curAnim.name.endsWith('miss') && animation.curAnim.finished && !debugMode)
{
playAnim('idle', true, false, 10);
}
2021-03-18 14:15:54 -04:00
if (animation.curAnim.name == 'firstDeath' && animation.curAnim.finished && startedDeath)
2021-01-14 23:33:12 -05:00
{
playAnim('deathLoop');
}
2020-10-27 06:35:23 -04:00
}
2020-10-04 23:29:35 -04:00
super.update(elapsed);
}
2020-10-04 14:50:12 -04:00
}