From f411cdac8805a721c7ea0b18b4023b7dc37a158c Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sun, 16 Apr 2023 15:33:20 -0400 Subject: [PATCH 1/9] different result screen in progress --- hmm.json | 4 +- .../graphics/adobeanimate/FlxAtlasSprite.hx | 9 ++- source/funkin/play/ResultState.hx | 72 ++++++++++++------- 3 files changed, 53 insertions(+), 32 deletions(-) diff --git a/hmm.json b/hmm.json index 69f5827a5..fd04b6b96 100644 --- a/hmm.json +++ b/hmm.json @@ -30,8 +30,8 @@ "name": "flxanimate", "type": "git", "dir": null, - "ref": "49f5554", - "url": "https://github.com/Dot-Stuff/flxanimate" + "ref": "6bc8992", + "url": "https://github.com/ninjamuffin99/flxanimate" }, { "name": "format", diff --git a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx index e79b06277..aad9cd851 100644 --- a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx +++ b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx @@ -31,9 +31,11 @@ class FlxAtlasSprite extends FlxAnimate 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) { @@ -55,7 +57,8 @@ class FlxAtlasSprite extends FlxAnimate */ public function listAnimations():Array { - return this.anim.getFrameLabels(); + // return this.anim.getFrameLabels(); + return [""]; } /** diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 59879c5a4..aef346ec5 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -1,5 +1,6 @@ package funkin.play; +import funkin.graphics.adobeanimate.FlxAtlasSprite; import flixel.FlxBasic; import flixel.FlxSprite; import flixel.graphics.frames.FlxAtlasFrames; @@ -16,6 +17,7 @@ import flixel.util.FlxGradient; import flixel.util.FlxTimer; import funkin.shaderslmfao.LeftMaskShader; import funkin.ui.TallyCounter; +import flxanimate.FlxAnimate.Settings; class ResultState extends MusicBeatSubstate { @@ -50,12 +52,32 @@ class ResultState extends MusicBeatSubstate bg.scrollFactor.set(); 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, + 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); gf.frames = Paths.getSparrowAtlas('resultScreen/resultGirlfriendGOOD'); gf.animation.addByPrefix("clap", "Girlfriend Good Anim", 24, false); gf.visible = false; - gf.animation.finishCallback = _ -> - { + gf.animation.finishCallback = _ -> { gf.animation.play('clap', true, false, 9); }; add(gf); @@ -64,8 +86,7 @@ class ResultState extends MusicBeatSubstate boyfriend.frames = Paths.getSparrowAtlas('resultScreen/resultBoyfriendGOOD'); boyfriend.animation.addByPrefix("fall", "Boyfriend Good", 24, false); boyfriend.visible = false; - boyfriend.animation.finishCallback = function(_) - { + boyfriend.animation.finishCallback = function(_) { boyfriend.animation.play('fall', true, false, 14); }; @@ -75,8 +96,7 @@ class ResultState extends MusicBeatSubstate soundSystem.frames = Paths.getSparrowAtlas("resultScreen/soundSystem"); soundSystem.animation.addByPrefix("idle", "sound system", 24, false); soundSystem.visible = false; - new FlxTimer().start(0.4, _ -> - { + new FlxTimer().start(0.4, _ -> { soundSystem.animation.play("idle"); soundSystem.visible = true; }); @@ -193,20 +213,17 @@ class ResultState extends MusicBeatSubstate for (ind => rating in ratingGrp.members) { rating.visible = false; - new FlxTimer().start((0.3 * ind) + 0.55, _ -> - { + new FlxTimer().start((0.3 * ind) + 0.55, _ -> { rating.visible = true; 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.visible = true; - ratingsPopin.animation.finishCallback = anim -> - { + ratingsPopin.animation.finishCallback = anim -> { scorePopin.animation.play("score"); scorePopin.visible = true; @@ -215,15 +232,22 @@ class ResultState extends MusicBeatSubstate FlxTween.tween(highscoreNew, {y: highscoreNew.y + 10}, 0.8, {ease: FlxEase.quartOut}); }; - boyfriend.animation.play('fall'); - boyfriend.visible = true; - - new FlxTimer().start((1 / 24) * 22, _ -> + if (false) { - // plays about 22 frames (at 24fps timing) after bf spawns in - gf.animation.play('clap', true); - gf.visible = true; - }); + boyfriend.animation.play('fall'); + boyfriend.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!!!"); @@ -245,8 +269,7 @@ class ResultState extends MusicBeatSubstate songName.y = diffYTween - 30; songName.x = (difficulty.x + difficulty.width) + 20; - new FlxTimer().start(3, _ -> - { + new FlxTimer().start(3, _ -> { movingSongStuff = true; }); } @@ -297,11 +320,6 @@ class ResultState extends MusicBeatSubstate 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.COMMA) songName.angle -= 0.1; From c2e340ef1900a2d4fda8db038483adefaec7eaf9 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sun, 16 Apr 2023 18:57:18 -0400 Subject: [PATCH 2/9] variation and hmm fix --- hmm.json | 2 +- source/funkin/play/ResultState.hx | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hmm.json b/hmm.json index fd04b6b96..0a1c09327 100644 --- a/hmm.json +++ b/hmm.json @@ -30,7 +30,7 @@ "name": "flxanimate", "type": "git", "dir": null, - "ref": "6bc8992", + "ref": "a8976ff", "url": "https://github.com/ninjamuffin99/flxanimate" }, { diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index aef346ec5..59e7292ff 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -232,21 +232,21 @@ class ResultState extends MusicBeatSubstate FlxTween.tween(highscoreNew, {y: highscoreNew.y + 10}, 0.8, {ease: FlxEase.quartOut}); }; - if (false) + switch (resultsVariation) { - boyfriend.animation.play('fall'); - boyfriend.visible = true; + case NORMAL: + boyfriend.animation.play('fall'); + boyfriend.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(""); + 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; + }); + case PERFECT: + bfGfExcellent.visible = true; + bfGfExcellent.playAnimation(""); + default: } }); From b1dfbb2ef2e4e97d4d16a7b7efca9d3bb1dcf210 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 17 Apr 2023 11:02:45 -0400 Subject: [PATCH 3/9] shit one --- source/funkin/play/ResultState.hx | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 59e7292ff..7d6f75fff 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -52,10 +52,19 @@ class ResultState extends MusicBeatSubstate bg.scrollFactor.set(); add(bg); + var bgFlash:FlxSprite = FlxGradient.createGradientFlxSprite(FlxG.width, FlxG.height, [0xFFffeb69, 0xFFffe66a], 90); + bgFlash.scrollFactor.set(); + bgFlash.visible = false; + add(bgFlash); + var bfGfExcellent:FlxAtlasSprite = new FlxAtlasSprite(380, -170, Paths.animateAtlas("resultScreen/resultsBoyfriendExcellent", "shared")); bfGfExcellent.visible = false; - // trace(bfGfExcellent.listAnimations()); add(bfGfExcellent); + + var bfSHIT:FlxAtlasSprite = new FlxAtlasSprite(0, 20, Paths.animateAtlas("resultScreen/resultsBoyfriendSHIT", "shared")); + bfSHIT.visible = false; + add(bfSHIT); + var settings:Settings = { // ?ButtonSettings:Map, @@ -63,6 +72,7 @@ class ResultState extends MusicBeatSubstate Reversed: false, OnComplete: function() { bfGfExcellent.anim.curFrame = 28; + bfSHIT.anim.curFrame = 150; trace("repeated anim!!"); }, ShowPivot: false, @@ -72,6 +82,7 @@ class ResultState extends MusicBeatSubstate }; bfGfExcellent.setTheSettings(settings); + bfSHIT.setTheSettings(settings); var gf:FlxSprite = new FlxSprite(500, 300); gf.frames = Paths.getSparrowAtlas('resultScreen/resultGirlfriendGOOD'); @@ -232,12 +243,29 @@ class ResultState extends MusicBeatSubstate FlxTween.tween(highscoreNew, {y: highscoreNew.y + 10}, 0.8, {ease: FlxEase.quartOut}); }; + resultsVariation = SHIT; + switch (resultsVariation) { + case SHIT: + bfSHIT.visible = true; + bfSHIT.playAnimation(""); + case NORMAL: boyfriend.animation.play('fall'); boyfriend.visible = true; + new FlxTimer().start((1 / 24) * 12, _ -> { + bgFlash.visible = true; + FlxTween.tween(bgFlash, {alpha: 0}, 0.4); + new FlxTimer().start((1 / 24) * 2, _ -> + { + // bgFlash.alpha = 0.5; + + // bgFlash.visible = false; + }); + }); + new FlxTimer().start((1 / 24) * 22, _ -> { // plays about 22 frames (at 24fps timing) after bf spawns in gf.animation.play('clap', true); From e872dddd15f3c7be666ef9f3fe4c2898661f07cf Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 17 Apr 2023 17:59:22 -0400 Subject: [PATCH 4/9] looping fix --- hmm.json | 2 +- source/funkin/play/ResultState.hx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 0a1c09327..341eaf7ca 100644 --- a/hmm.json +++ b/hmm.json @@ -30,7 +30,7 @@ "name": "flxanimate", "type": "git", "dir": null, - "ref": "a8976ff", + "ref": "a913635", "url": "https://github.com/ninjamuffin99/flxanimate" }, { diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 7d6f75fff..6302e8068 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -73,6 +73,7 @@ class ResultState extends MusicBeatSubstate OnComplete: function() { bfGfExcellent.anim.curFrame = 28; bfSHIT.anim.curFrame = 150; + bfSHIT.anim.play(); // unpauses this anim, since it's on PlayOnce! trace("repeated anim!!"); }, ShowPivot: false, From 7c225bea1849cc3787f7cfeb9927df4c8d01ea3a Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 17 Apr 2023 17:59:47 -0400 Subject: [PATCH 5/9] no forced shit mode --- source/funkin/play/ResultState.hx | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 6302e8068..3d32c6cf8 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -244,8 +244,6 @@ class ResultState extends MusicBeatSubstate FlxTween.tween(highscoreNew, {y: highscoreNew.y + 10}, 0.8, {ease: FlxEase.quartOut}); }; - resultsVariation = SHIT; - switch (resultsVariation) { case SHIT: From 2fefb657ece0e2a39744df678dcdb74bf887b03e Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 19 Apr 2023 02:51:47 -0400 Subject: [PATCH 6/9] excellent looping issue --- source/funkin/play/ResultState.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 3d32c6cf8..29f2b3e9f 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -72,6 +72,7 @@ class ResultState extends MusicBeatSubstate Reversed: false, OnComplete: function() { bfGfExcellent.anim.curFrame = 28; + bfGfExcellent.anim.play(); // unpauses this anim, since it's on PlayOnce! bfSHIT.anim.curFrame = 150; bfSHIT.anim.play(); // unpauses this anim, since it's on PlayOnce! trace("repeated anim!!"); From b4468a45c3fbe62a797bf36c14e99c8786b1486f Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 19 Apr 2023 03:00:52 -0400 Subject: [PATCH 7/9] no more shit loops! --- source/funkin/play/ResultState.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 29f2b3e9f..2bbaea4c5 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -39,7 +39,9 @@ class ResultState extends MusicBeatSubstate else resultsVariation = NORMAL; - FlxG.sound.playMusic(Paths.music("results" + resultsVariation)); + var loops = resultsVariation != SHIT; + + FlxG.sound.playMusic(Paths.music("results" + resultsVariation), 1, loops); // TEMP-ish, just used to sorta "cache" the 3000x3000 image! var cacheBullShit = new FlxSprite().loadGraphic(Paths.image("resultScreen/soundSystem")); From 6fe747eac16a0dc592a927a52e68cfaab9e8b4c6 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 19 Apr 2023 04:08:03 -0400 Subject: [PATCH 8/9] true perfect --- source/funkin/play/ResultState.hx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 2bbaea4c5..f7fd52380 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -63,6 +63,10 @@ class ResultState extends MusicBeatSubstate bfGfExcellent.visible = false; add(bfGfExcellent); + var bfPerfect:FlxAtlasSprite = new FlxAtlasSprite(370, -180, Paths.animateAtlas("resultScreen/resultsBoyfriendPerfect", "shared")); + bfPerfect.visible = false; + add(bfPerfect); + var bfSHIT:FlxAtlasSprite = new FlxAtlasSprite(0, 20, Paths.animateAtlas("resultScreen/resultsBoyfriendSHIT", "shared")); bfSHIT.visible = false; add(bfSHIT); @@ -77,6 +81,10 @@ class ResultState extends MusicBeatSubstate bfGfExcellent.anim.play(); // unpauses this anim, since it's on PlayOnce! bfSHIT.anim.curFrame = 150; bfSHIT.anim.play(); // unpauses this anim, since it's on PlayOnce! + + bfPerfect.anim.curFrame = 136; + bfPerfect.anim.play(); // unpauses this anim, since it's on PlayOnce! + trace("repeated anim!!"); }, ShowPivot: false, @@ -87,6 +95,7 @@ class ResultState extends MusicBeatSubstate bfGfExcellent.setTheSettings(settings); bfSHIT.setTheSettings(settings); + bfPerfect.setTheSettings(settings); var gf:FlxSprite = new FlxSprite(500, 300); gf.frames = Paths.getSparrowAtlas('resultScreen/resultGirlfriendGOOD'); @@ -274,8 +283,11 @@ class ResultState extends MusicBeatSubstate gf.visible = true; }); case PERFECT: - bfGfExcellent.visible = true; - bfGfExcellent.playAnimation(""); + bfPerfect.visible = true; + bfPerfect.playAnimation(""); + + // bfGfExcellent.visible = true; + // bfGfExcellent.playAnimation(""); default: } }); @@ -363,6 +375,7 @@ class ResultState extends MusicBeatSubstate enum abstract ResultVariations(String) { var PERFECT; + var EXCELLENT; var NORMAL; var SHIT; } From e802aa885b08cb557255e09d2c3fdf1c71c192aa Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Fri, 21 Apr 2023 17:39:27 -0400 Subject: [PATCH 9/9] gf shit fix --- source/funkin/play/ResultState.hx | 37 +++++++++++-------------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index f7fd52380..bdf4c19c9 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -28,7 +28,7 @@ class ResultState extends MusicBeatSubstate var maskShaderSongName = new LeftMaskShader(); var maskShaderDifficulty = new LeftMaskShader(); - override function create() + override function create():Void { if (Highscore.tallies.sick == Highscore.tallies.totalNotesHit && Highscore.tallies.maxCombo == Highscore.tallies.totalNotesHit) resultsVariation = PERFECT; @@ -71,31 +71,20 @@ class ResultState extends MusicBeatSubstate bfSHIT.visible = false; add(bfSHIT); - var settings:Settings = - { - // ?ButtonSettings:Map, - FrameRate: 24.0, - Reversed: false, - OnComplete: function() { - bfGfExcellent.anim.curFrame = 28; - bfGfExcellent.anim.play(); // unpauses this anim, since it's on PlayOnce! - bfSHIT.anim.curFrame = 150; - bfSHIT.anim.play(); // unpauses this anim, since it's on PlayOnce! + bfGfExcellent.anim.onComplete = () -> { + bfGfExcellent.anim.curFrame = 28; + bfGfExcellent.anim.play(); // unpauses this anim, since it's on PlayOnce! + }; - bfPerfect.anim.curFrame = 136; - bfPerfect.anim.play(); // unpauses this anim, since it's on PlayOnce! + bfPerfect.anim.onComplete = () -> { + bfPerfect.anim.curFrame = 136; + bfPerfect.anim.play(); // unpauses this anim, since it's on PlayOnce! + }; - 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); - bfSHIT.setTheSettings(settings); - bfPerfect.setTheSettings(settings); + bfSHIT.anim.onComplete = () -> { + bfSHIT.anim.curFrame = 150; + bfSHIT.anim.play(); // unpauses this anim, since it's on PlayOnce! + }; var gf:FlxSprite = new FlxSprite(500, 300); gf.frames = Paths.getSparrowAtlas('resultScreen/resultGirlfriendGOOD');