1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-02-09 13:07:10 +00:00

different result screen in progress

This commit is contained in:
Cameron Taylor 2023-04-16 15:33:20 -04:00
parent 5a0ce60b36
commit f411cdac88
3 changed files with 53 additions and 32 deletions

View file

@ -30,8 +30,8 @@
"name": "flxanimate", "name": "flxanimate",
"type": "git", "type": "git",
"dir": null, "dir": null,
"ref": "49f5554", "ref": "6bc8992",
"url": "https://github.com/Dot-Stuff/flxanimate" "url": "https://github.com/ninjamuffin99/flxanimate"
}, },
{ {
"name": "format", "name": "format",

View file

@ -31,9 +31,11 @@ class FlxAtlasSprite extends FlxAnimate
var canPlayOtherAnims:Bool = true; var canPlayOtherAnims:Bool = true;
public function new(x:Float, y:Float, path:String) public function new(x:Float, y:Float, path:String, ?settings:Settings)
{ {
super(x, y, path); if (settings == null) settings = SETTINGS;
super(x, y, path, settings);
if (this.anim.curInstance == null) if (this.anim.curInstance == null)
{ {
@ -55,7 +57,8 @@ class FlxAtlasSprite extends FlxAnimate
*/ */
public function listAnimations():Array<String> public function listAnimations():Array<String>
{ {
return this.anim.getFrameLabels(); // return this.anim.getFrameLabels();
return [""];
} }
/** /**

View file

@ -1,5 +1,6 @@
package funkin.play; package funkin.play;
import funkin.graphics.adobeanimate.FlxAtlasSprite;
import flixel.FlxBasic; import flixel.FlxBasic;
import flixel.FlxSprite; import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames; import flixel.graphics.frames.FlxAtlasFrames;
@ -16,6 +17,7 @@ import flixel.util.FlxGradient;
import flixel.util.FlxTimer; import flixel.util.FlxTimer;
import funkin.shaderslmfao.LeftMaskShader; import funkin.shaderslmfao.LeftMaskShader;
import funkin.ui.TallyCounter; import funkin.ui.TallyCounter;
import flxanimate.FlxAnimate.Settings;
class ResultState extends MusicBeatSubstate class ResultState extends MusicBeatSubstate
{ {
@ -50,12 +52,32 @@ class ResultState extends MusicBeatSubstate
bg.scrollFactor.set(); bg.scrollFactor.set();
add(bg); add(bg);
var bfGfExcellent:FlxAtlasSprite = new FlxAtlasSprite(380, -170, Paths.animateAtlas("resultScreen/resultsBoyfriendExcellent", "shared"));
bfGfExcellent.visible = false;
// trace(bfGfExcellent.listAnimations());
add(bfGfExcellent);
var settings:Settings =
{
// ?ButtonSettings:Map<String, flxanimate.animate.FlxAnim.ButtonSettings>,
FrameRate: 24.0,
Reversed: false,
OnComplete: function() {
bfGfExcellent.anim.curFrame = 28;
trace("repeated anim!!");
},
ShowPivot: false,
Antialiasing: true,
ScrollFactor: new FlxPoint(1, 1),
// Offset: new FlxPoint(0, 0), // This is just FlxSprite.offset
};
bfGfExcellent.setTheSettings(settings);
var gf:FlxSprite = new FlxSprite(500, 300); var gf:FlxSprite = new FlxSprite(500, 300);
gf.frames = Paths.getSparrowAtlas('resultScreen/resultGirlfriendGOOD'); gf.frames = Paths.getSparrowAtlas('resultScreen/resultGirlfriendGOOD');
gf.animation.addByPrefix("clap", "Girlfriend Good Anim", 24, false); gf.animation.addByPrefix("clap", "Girlfriend Good Anim", 24, false);
gf.visible = false; gf.visible = false;
gf.animation.finishCallback = _ -> gf.animation.finishCallback = _ -> {
{
gf.animation.play('clap', true, false, 9); gf.animation.play('clap', true, false, 9);
}; };
add(gf); add(gf);
@ -64,8 +86,7 @@ class ResultState extends MusicBeatSubstate
boyfriend.frames = Paths.getSparrowAtlas('resultScreen/resultBoyfriendGOOD'); boyfriend.frames = Paths.getSparrowAtlas('resultScreen/resultBoyfriendGOOD');
boyfriend.animation.addByPrefix("fall", "Boyfriend Good", 24, false); boyfriend.animation.addByPrefix("fall", "Boyfriend Good", 24, false);
boyfriend.visible = false; boyfriend.visible = false;
boyfriend.animation.finishCallback = function(_) boyfriend.animation.finishCallback = function(_) {
{
boyfriend.animation.play('fall', true, false, 14); boyfriend.animation.play('fall', true, false, 14);
}; };
@ -75,8 +96,7 @@ class ResultState extends MusicBeatSubstate
soundSystem.frames = Paths.getSparrowAtlas("resultScreen/soundSystem"); soundSystem.frames = Paths.getSparrowAtlas("resultScreen/soundSystem");
soundSystem.animation.addByPrefix("idle", "sound system", 24, false); soundSystem.animation.addByPrefix("idle", "sound system", 24, false);
soundSystem.visible = false; soundSystem.visible = false;
new FlxTimer().start(0.4, _ -> new FlxTimer().start(0.4, _ -> {
{
soundSystem.animation.play("idle"); soundSystem.animation.play("idle");
soundSystem.visible = true; soundSystem.visible = true;
}); });
@ -193,20 +213,17 @@ class ResultState extends MusicBeatSubstate
for (ind => rating in ratingGrp.members) for (ind => rating in ratingGrp.members)
{ {
rating.visible = false; rating.visible = false;
new FlxTimer().start((0.3 * ind) + 0.55, _ -> new FlxTimer().start((0.3 * ind) + 0.55, _ -> {
{
rating.visible = true; rating.visible = true;
FlxTween.tween(rating, {curNumber: rating.neededNumber}, 0.5, {ease: FlxEase.quartOut}); FlxTween.tween(rating, {curNumber: rating.neededNumber}, 0.5, {ease: FlxEase.quartOut});
}); });
} }
new FlxTimer().start(0.5, _ -> new FlxTimer().start(0.5, _ -> {
{
ratingsPopin.animation.play("idle"); ratingsPopin.animation.play("idle");
ratingsPopin.visible = true; ratingsPopin.visible = true;
ratingsPopin.animation.finishCallback = anim -> ratingsPopin.animation.finishCallback = anim -> {
{
scorePopin.animation.play("score"); scorePopin.animation.play("score");
scorePopin.visible = true; scorePopin.visible = true;
@ -215,15 +232,22 @@ class ResultState extends MusicBeatSubstate
FlxTween.tween(highscoreNew, {y: highscoreNew.y + 10}, 0.8, {ease: FlxEase.quartOut}); FlxTween.tween(highscoreNew, {y: highscoreNew.y + 10}, 0.8, {ease: FlxEase.quartOut});
}; };
boyfriend.animation.play('fall'); if (false)
boyfriend.visible = true;
new FlxTimer().start((1 / 24) * 22, _ ->
{ {
// plays about 22 frames (at 24fps timing) after bf spawns in boyfriend.animation.play('fall');
gf.animation.play('clap', true); boyfriend.visible = true;
gf.visible = true;
}); new FlxTimer().start((1 / 24) * 22, _ -> {
// plays about 22 frames (at 24fps timing) after bf spawns in
gf.animation.play('clap', true);
gf.visible = true;
});
}
else
{
bfGfExcellent.visible = true;
bfGfExcellent.playAnimation("");
}
}); });
if (Highscore.tallies.isNewHighscore) trace("ITS A NEW HIGHSCORE!!!"); if (Highscore.tallies.isNewHighscore) trace("ITS A NEW HIGHSCORE!!!");
@ -245,8 +269,7 @@ class ResultState extends MusicBeatSubstate
songName.y = diffYTween - 30; songName.y = diffYTween - 30;
songName.x = (difficulty.x + difficulty.width) + 20; songName.x = (difficulty.x + difficulty.width) + 20;
new FlxTimer().start(3, _ -> new FlxTimer().start(3, _ -> {
{
movingSongStuff = true; movingSongStuff = true;
}); });
} }
@ -297,11 +320,6 @@ class ResultState extends MusicBeatSubstate
if (FlxG.keys.justPressed.DOWN) speedOfTween.y += 0.1; if (FlxG.keys.justPressed.DOWN) speedOfTween.y += 0.1;
if (FlxG.keys.pressed.V)
{
trace(speedOfTween);
}
if (FlxG.keys.justPressed.PERIOD) songName.angle += 0.1; if (FlxG.keys.justPressed.PERIOD) songName.angle += 0.1;
if (FlxG.keys.justPressed.COMMA) songName.angle -= 0.1; if (FlxG.keys.justPressed.COMMA) songName.angle -= 0.1;