mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-01-27 15:26:55 +00:00
LOSS SCREEN WIP
This commit is contained in:
parent
cdf7ea1eed
commit
6b076faaf7
|
@ -21,7 +21,7 @@ class AnimationDebug extends FlxState
|
|||
var dumbTexts:FlxTypedGroup<FlxText>;
|
||||
var animList:Array<String> = [];
|
||||
var curAnim:Int = 0;
|
||||
var isDad:Bool = true;
|
||||
var isDad:Bool = false;
|
||||
var daAnim:String = 'spooky';
|
||||
var camFollow:FlxObject;
|
||||
|
||||
|
|
|
@ -26,6 +26,10 @@ class Boyfriend extends Character
|
|||
animation.addByPrefix('singRIGHTmiss', 'BF NOTE RIGHT MISS', 24, false);
|
||||
animation.addByPrefix('singDOWNmiss', 'BF NOTE DOWN MISS', 24, false);
|
||||
animation.addByPrefix('hey', 'BF HEY', 24, false);
|
||||
|
||||
animation.addByPrefix('firstDeath', "BF dies", 24, false);
|
||||
animation.addByPrefix('deathLoop', "BF Dead Loop", 24, true);
|
||||
animation.addByPrefix('deathConfirm', "BF Dead confirm", 24, false);
|
||||
playAnim('idle');
|
||||
|
||||
antialiasing = true;
|
||||
|
@ -40,6 +44,9 @@ class Boyfriend extends Character
|
|||
addOffset("singLEFTmiss", 12, 24);
|
||||
addOffset("singDOWNmiss", -11, -19);
|
||||
addOffset("hey", 7, 4);
|
||||
addOffset('firstDeath', 37, 11);
|
||||
addOffset('deathLoop', 37, 5);
|
||||
addOffset('deathConfirm', 37, 69);
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
|
@ -48,6 +55,12 @@ class Boyfriend extends Character
|
|||
{
|
||||
playAnim('idle', true, false, 10);
|
||||
}
|
||||
|
||||
if (animation.curAnim.name == 'firstDeath' && animation.curAnim.finished)
|
||||
{
|
||||
playAnim('deathLoop');
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import flixel.text.FlxText;
|
|||
|
||||
class FreeplayState extends MusicBeatState
|
||||
{
|
||||
var songs:Array<String> = ["Bopeebo", "Dadbattle", "Fresh", "Tutorial\nlol"];
|
||||
var songs:Array<String> = ["Bopeebo", "Dadbattle", "Fresh", "Tutorial", "Spookeez"];
|
||||
|
||||
var selector:FlxText;
|
||||
var curSelected:Int = 0;
|
||||
|
|
|
@ -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;
|
||||
|
|
47
source/GameOverSubstate.hx
Normal file
47
source/GameOverSubstate.hx
Normal file
|
@ -0,0 +1,47 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.math.FlxPoint;
|
||||
|
||||
class GameOverSubstate extends FlxSubState
|
||||
{
|
||||
var bf:Boyfriend;
|
||||
var camFollow:FlxObject;
|
||||
|
||||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super();
|
||||
|
||||
bf = new Boyfriend(x, y);
|
||||
add(bf);
|
||||
|
||||
camFollow = new FlxObject(bf.getGraphicMidpoint().x, bf.getGraphicMidpoint().y, 1, 1);
|
||||
add(camFollow);
|
||||
|
||||
FlxG.sound.play('assets/sounds/fnf_loss_sfx' + TitleState.soundExt);
|
||||
|
||||
// FlxG.camera.followLerp = 1;
|
||||
// FlxG.camera.focusOn(FlxPoint.get(FlxG.width / 2, FlxG.height / 2));
|
||||
FlxG.camera.scroll.set();
|
||||
FlxG.camera.target = null;
|
||||
|
||||
bf.playAnim('firstDeath');
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.curFrame == 12)
|
||||
{
|
||||
FlxG.camera.follow(camFollow, LOCKON, 0.01);
|
||||
}
|
||||
|
||||
if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.finished)
|
||||
{
|
||||
FlxG.sound.playMusic('assets/music/gameOver' + TitleState.soundExt);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ class Main extends Sprite
|
|||
public function new()
|
||||
{
|
||||
super();
|
||||
addChild(new FlxGame(0, 0, TitleState));
|
||||
addChild(new FlxGame(0, 0, FreeplayState));
|
||||
|
||||
#if !mobile
|
||||
addChild(new FPS(10, 3, 0xFFFFFF));
|
||||
|
|
|
@ -9,7 +9,7 @@ import flixel.util.FlxColor;
|
|||
|
||||
class PauseSubState extends FlxSubState
|
||||
{
|
||||
public function new()
|
||||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super();
|
||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
|
@ -17,6 +17,12 @@ class PauseSubState extends FlxSubState
|
|||
bg.scrollFactor.set();
|
||||
add(bg);
|
||||
|
||||
var bf:Boyfriend = new Boyfriend(x, y);
|
||||
bf.scrollFactor.set();
|
||||
// add(bf);
|
||||
|
||||
bf.playAnim('firstDeath');
|
||||
|
||||
bg.cameras = [FlxG.cameras.list[1]];
|
||||
}
|
||||
|
||||
|
|
|
@ -526,7 +526,7 @@ class PlayState extends MusicBeatState
|
|||
persistentDraw = true;
|
||||
paused = true;
|
||||
|
||||
openSubState(new PauseSubState());
|
||||
openSubState(new PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.ESCAPE)
|
||||
|
@ -548,7 +548,7 @@ class PlayState extends MusicBeatState
|
|||
/* if (FlxG.keys.justPressed.NINE)
|
||||
FlxG.switchState(new Charting()); */
|
||||
if (FlxG.keys.justPressed.EIGHT)
|
||||
FlxG.switchState(new AnimationDebug(SONG.player2));
|
||||
FlxG.switchState(new AnimationDebug(SONG.player1));
|
||||
|
||||
if (startingSong)
|
||||
{
|
||||
|
@ -667,7 +667,17 @@ class PlayState extends MusicBeatState
|
|||
if (health <= 0)
|
||||
{
|
||||
boyfriend.stunned = true;
|
||||
FlxG.switchState(new GameOverState());
|
||||
|
||||
persistentUpdate = false;
|
||||
persistentDraw = false;
|
||||
paused = true;
|
||||
|
||||
vocals.stop();
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||
|
||||
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||
}
|
||||
|
||||
if (unspawnNotes[0] != null)
|
||||
|
@ -744,9 +754,8 @@ class PlayState extends MusicBeatState
|
|||
private function popUpScore(strumtime:Float):Void
|
||||
{
|
||||
var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition);
|
||||
|
||||
// boyfriend.playAnim('hey');
|
||||
// vocals.volume = 1;
|
||||
vocals.volume = 1;
|
||||
|
||||
var placement:String = Std.string(combo);
|
||||
// var placement:String = sectionScores[1][curSection] + '/' + sectionScores[0][curSection];
|
||||
|
|
|
@ -130,7 +130,7 @@ class TitleState extends MusicBeatState
|
|||
|
||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||
{
|
||||
FlxG.switchState(new PlayState());
|
||||
FlxG.switchState(new FreeplayState());
|
||||
});
|
||||
FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
|
||||
}
|
||||
|
@ -232,6 +232,7 @@ class TitleState extends MusicBeatState
|
|||
{
|
||||
FlxG.camera.flash(FlxColor.WHITE, 4);
|
||||
remove(credGroup);
|
||||
skippedIntro = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue