LOSS SCREEN WIP
This commit is contained in:
@ -10,26 +10,44 @@ import flixel.tweens.FlxTween;
|
||||
|
||||
class GameOverState extends FlxTransitionableState
|
||||
{
|
||||
var bfX:Float = 0;
|
||||
var bfY:Float = 0;
|
||||
|
||||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super();
|
||||
|
||||
bfX = x;
|
||||
bfY = y;
|
||||
}
|
||||
|
||||
override function create()
|
||||
{
|
||||
var loser:FlxSprite = new FlxSprite(100, 100);
|
||||
var loseTex = FlxAtlasFrames.fromSparrow(AssetPaths.lose__png, AssetPaths.lose__xml);
|
||||
loser.frames = loseTex;
|
||||
loser.animation.addByPrefix('lose', 'lose', 24, false);
|
||||
loser.animation.play('lose');
|
||||
add(loser);
|
||||
/* var loser:FlxSprite = new FlxSprite(100, 100);
|
||||
var loseTex = FlxAtlasFrames.fromSparrow(AssetPaths.lose__png, AssetPaths.lose__xml);
|
||||
loser.frames = loseTex;
|
||||
loser.animation.addByPrefix('lose', 'lose', 24, false);
|
||||
loser.animation.play('lose');
|
||||
// add(loser); */
|
||||
|
||||
var restart:FlxSprite = new FlxSprite(500, 50).loadGraphic(AssetPaths.restart__png);
|
||||
restart.setGraphicSize(Std.int(restart.width * 0.6));
|
||||
restart.updateHitbox();
|
||||
restart.alpha = 0;
|
||||
restart.antialiasing = true;
|
||||
add(restart);
|
||||
var bf:Boyfriend = new Boyfriend(bfX, bfY);
|
||||
// bf.scrollFactor.set();
|
||||
add(bf);
|
||||
bf.playAnim('firstDeath');
|
||||
|
||||
FlxG.camera.follow(bf, LOCKON, 0.001);
|
||||
/*
|
||||
var restart:FlxSprite = new FlxSprite(500, 50).loadGraphic(AssetPaths.restart__png);
|
||||
restart.setGraphicSize(Std.int(restart.width * 0.6));
|
||||
restart.updateHitbox();
|
||||
restart.alpha = 0;
|
||||
restart.antialiasing = true;
|
||||
// add(restart); */
|
||||
|
||||
FlxG.sound.music.fadeOut(2, FlxG.sound.music.volume * 0.6);
|
||||
|
||||
FlxTween.tween(restart, {alpha: 1}, 1, {ease: FlxEase.quartInOut});
|
||||
FlxTween.tween(restart, {y: restart.y + 40}, 7, {ease: FlxEase.quartInOut, type: PINGPONG});
|
||||
// FlxTween.tween(restart, {alpha: 1}, 1, {ease: FlxEase.quartInOut});
|
||||
// FlxTween.tween(restart, {y: restart.y + 40}, 7, {ease: FlxEase.quartInOut, type: PINGPONG});
|
||||
|
||||
super.create();
|
||||
}
|
||||
@ -48,6 +66,8 @@ class GameOverState extends FlxTransitionableState
|
||||
pressed = true;
|
||||
}
|
||||
|
||||
pressed = false;
|
||||
|
||||
if (pressed && !fading)
|
||||
{
|
||||
fading = true;
|
||||
|
Reference in New Issue
Block a user