cute animations in progress teehee

This commit is contained in:
Cameron Taylor
2020-10-28 00:03:32 -07:00
parent 0c31cc29ee
commit b68fb4f5de
5 changed files with 64 additions and 86 deletions

View File

@ -4,6 +4,8 @@ import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSubState;
import flixel.math.FlxPoint;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
class GameOverSubstate extends FlxSubState
{
@ -34,6 +36,11 @@ class GameOverSubstate extends FlxSubState
{
super.update(elapsed);
if (FlxG.keys.justPressed.ENTER)
{
endBullshit();
}
if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.curFrame == 12)
{
FlxG.camera.follow(camFollow, LOCKON, 0.01);
@ -44,4 +51,24 @@ class GameOverSubstate extends FlxSubState
FlxG.sound.playMusic('assets/music/gameOver' + TitleState.soundExt);
}
}
var isEnding:Bool = false;
function endBullshit():Void
{
if (!isEnding)
{
isEnding = true;
bf.playAnim('deathConfirm', true);
FlxG.sound.music.stop();
FlxG.sound.play('assets/music/gameOverEnd' + TitleState.soundExt);
new FlxTimer().start(0.7, function(tmr:FlxTimer)
{
FlxG.camera.fade(FlxColor.BLACK, 2, false, function()
{
FlxG.switchState(new PlayState());
});
});
}
}
}