1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-08-18 14:05:06 +00:00

Merge pull request #101 from FunkinCrew/death-alt

Death alt
This commit is contained in:
Cameron Taylor 2023-06-15 13:19:21 -04:00 committed by GitHub
commit dff48c3013
2 changed files with 29 additions and 7 deletions

View file

@ -16,7 +16,7 @@ class FlxAtlasSprite extends FlxAnimate
FrameRate: 24.0,
Reversed: false,
// ?OnComplete:Void -> Void,
ShowPivot: #if debug true #else false #end,
ShowPivot: #if debug false #else false #end,
Antialiasing: true,
ScrollFactor: new FlxPoint(1, 1),
// Offset: new FlxPoint(0, 0), // This is just FlxSprite.offset

View file

@ -1,5 +1,6 @@
package funkin.play;
import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.system.FlxSound;
@ -97,7 +98,6 @@ class GameOverSubState extends MusicBeatSubState
boyfriend.isDead = true;
add(boyfriend);
boyfriend.resetCharacter();
boyfriend.playAnimation('firstDeath', true, true);
// Assign a camera follow point to the boyfriend's position.
cameraFollowPoint = new FlxObject(PlayState.instance.cameraFollowPoint.x, PlayState.instance.cameraFollowPoint.y, 1, 1);
@ -118,15 +118,30 @@ class GameOverSubState extends MusicBeatSubState
// The conductor now represents the BPM of the game over music.
Conductor.songPosition = 0;
// Play the "blue balled" sound. May play a variant if one has been assigned.
playBlueBalledSFX();
}
var hasStartedAnimation:Bool = false;
override function update(elapsed:Float)
{
super.update(elapsed);
if (!hasStartedAnimation)
{
hasStartedAnimation = true;
if (boyfriend.hasAnimation('fakeoutDeath') && FlxG.random.bool((1 / 4096) * 100))
{
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.
//
@ -145,14 +160,18 @@ class GameOverSubState extends MusicBeatSubState
}
// KEYBOARD ONLY: Restart the level when pressing the assigned key.
if (controls.ACCEPT)
if (controls.ACCEPT && blueballed)
{
blueballed = false;
confirmDeath();
}
// KEYBOARD ONLY: Return to the menu when pressing the assigned key.
if (controls.BACK)
{
blueballed = false;
PlayState.deathCounter = 0;
PlayState.seenCutscene = false;
gameOverMusic.stop();
if (PlayStatePlaylist.isStoryMode) FlxG.switchState(new StoryMenuState());
@ -252,12 +271,15 @@ class GameOverSubState extends MusicBeatSubState
}
}
static var blueballed:Bool = false;
/**
* Play the sound effect that occurs when
* boyfriend's testicles get utterly annihilated.
*/
function playBlueBalledSFX()
public static function playBlueBalledSFX()
{
blueballed = true;
FlxG.sound.play(Paths.sound('fnf_loss_sfx' + blueBallSuffix));
}