mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-25 16:24:40 +00:00
Fakeout death now uses HScript
This commit is contained in:
parent
2d16aab488
commit
374f03dae3
|
@ -1,6 +1,5 @@
|
|||
package funkin.play;
|
||||
|
||||
import funkin.graphics.adobeanimate.FlxAtlasSprite;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSprite;
|
||||
|
@ -100,29 +99,6 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||
add(boyfriend);
|
||||
boyfriend.resetCharacter();
|
||||
|
||||
if (boyfriend.characterId == "bf" && animationSuffix == "" && FlxG.random.bool((1 / 4000) * 100))
|
||||
{
|
||||
FlxG.sound.play(Paths.sound("fakeout_death"));
|
||||
|
||||
var bfFake:FlxAtlasSprite = new FlxAtlasSprite(boyfriend.x - 440, boyfriend.y - 240, Paths.animateAtlas("characters/bfFakeOut", "shared"),);
|
||||
add(bfFake);
|
||||
bfFake.playAnimation("");
|
||||
bfFake.anim.onComplete = () -> {
|
||||
bfFake.visible = false;
|
||||
boyfriend.visible = true;
|
||||
boyfriend.playAnimation('firstDeath', true, true);
|
||||
// Play the "blue balled" sound. May play a variant if one has been assigned.
|
||||
playBlueBalledSFX();
|
||||
};
|
||||
boyfriend.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
boyfriend.playAnimation('firstDeath', true, true);
|
||||
// Play the "blue balled" sound. May play a variant if one has been assigned.
|
||||
playBlueBalledSFX();
|
||||
}
|
||||
|
||||
// Assign a camera follow point to the boyfriend's position.
|
||||
cameraFollowPoint = new FlxObject(PlayState.instance.cameraFollowPoint.x, PlayState.instance.cameraFollowPoint.y, 1, 1);
|
||||
cameraFollowPoint.x = boyfriend.getGraphicMidpoint().x;
|
||||
|
@ -144,10 +120,28 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||
Conductor.songPosition = 0;
|
||||
}
|
||||
|
||||
var hasStartedAnimation:Bool = false;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (!hasStartedAnimation)
|
||||
{
|
||||
hasStartedAnimation = true;
|
||||
|
||||
if (boyfriend.hasAnimation('fakeoutDeath') && (FlxG.random.bool((1 / 4000) * 100) || true))
|
||||
{
|
||||
boyfriend.playAnimation('fakeoutDeath', true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
boyfriend.playAnimation('firstDeath', true, true);
|
||||
// Play the "blue balled" sound. May play a variant if one has been assigned.
|
||||
playBlueBalledSFX();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Handle user inputs.
|
||||
//
|
||||
|
@ -279,7 +273,7 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||
* Play the sound effect that occurs when
|
||||
* boyfriend's testicles get utterly annihilated.
|
||||
*/
|
||||
function playBlueBalledSFX()
|
||||
public static function playBlueBalledSFX()
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('fnf_loss_sfx' + blueBallSuffix));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue