mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-03-23 10:29:29 +00:00
boyfriend blink code
This commit is contained in:
parent
82bb619864
commit
66f77a985f
|
@ -21,7 +21,10 @@ class DJBoyfriend extends FlxAtlasSprite
|
||||||
// TODO: Switch this class to use SwagSprite instead.
|
// TODO: Switch this class to use SwagSprite instead.
|
||||||
public var animOffsets:Map<String, Array<Dynamic>>;
|
public var animOffsets:Map<String, Array<Dynamic>>;
|
||||||
|
|
||||||
static final SPOOK_PERIOD:Float = 180.0;
|
var gotSpooked:Bool = false;
|
||||||
|
|
||||||
|
static final SPOOK_PERIOD:Float = 120.0;
|
||||||
|
static final TV_PERIOD:Float = 180.0;
|
||||||
|
|
||||||
// Time since dad last SPOOKED you.
|
// Time since dad last SPOOKED you.
|
||||||
var timeSinceSpook:Float = 0;
|
var timeSinceSpook:Float = 0;
|
||||||
|
@ -36,8 +39,13 @@ class DJBoyfriend extends FlxAtlasSprite
|
||||||
trace(listAnimations());
|
trace(listAnimations());
|
||||||
|
|
||||||
FlxG.debugger.track(this);
|
FlxG.debugger.track(this);
|
||||||
|
FlxG.console.registerObject("dj", this);
|
||||||
|
|
||||||
anim.onComplete = onFinishAnim;
|
anim.onComplete = onFinishAnim;
|
||||||
|
|
||||||
|
FlxG.console.registerFunction("tv", function() {
|
||||||
|
currentState = TV;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -69,10 +77,14 @@ class DJBoyfriend extends FlxAtlasSprite
|
||||||
// We are in this state the majority of the time.
|
// We are in this state the majority of the time.
|
||||||
if (getCurrentAnimation() != 'Boyfriend DJ' || anim.finished)
|
if (getCurrentAnimation() != 'Boyfriend DJ' || anim.finished)
|
||||||
{
|
{
|
||||||
if (timeSinceSpook > SPOOK_PERIOD)
|
if (timeSinceSpook > SPOOK_PERIOD && !gotSpooked)
|
||||||
{
|
{
|
||||||
currentState = Spook;
|
currentState = Spook;
|
||||||
}
|
}
|
||||||
|
else if (timeSinceSpook > TV_PERIOD)
|
||||||
|
{
|
||||||
|
currentState = TV;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playFlashAnimation('Boyfriend DJ', false);
|
playFlashAnimation('Boyfriend DJ', false);
|
||||||
|
@ -91,6 +103,7 @@ class DJBoyfriend extends FlxAtlasSprite
|
||||||
timeSinceSpook = 0;
|
timeSinceSpook = 0;
|
||||||
case TV:
|
case TV:
|
||||||
if (getCurrentAnimation() != 'Boyfriend DJ watchin tv OG') playFlashAnimation('Boyfriend DJ watchin tv OG', true);
|
if (getCurrentAnimation() != 'Boyfriend DJ watchin tv OG') playFlashAnimation('Boyfriend DJ watchin tv OG', true);
|
||||||
|
timeSinceSpook = 0;
|
||||||
default:
|
default:
|
||||||
// I shit myself.
|
// I shit myself.
|
||||||
}
|
}
|
||||||
|
@ -113,7 +126,8 @@ class DJBoyfriend extends FlxAtlasSprite
|
||||||
case "Boyfriend DJ confirm":
|
case "Boyfriend DJ confirm":
|
||||||
|
|
||||||
case "Boyfriend DJ watchin tv OG":
|
case "Boyfriend DJ watchin tv OG":
|
||||||
anim.play("Boyfriend DJ watchin tv OG", true, false, 112);
|
var frame:Int = FlxG.random.bool(33) ? 112 : 166;
|
||||||
|
anim.play("Boyfriend DJ watchin tv OG", true, false, frame);
|
||||||
// trace('Finished confirm');
|
// trace('Finished confirm');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue