2022-09-20 02:16:12 -04:00
|
|
|
package funkin.play;
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
import funkin.util.MathUtil;
|
2023-06-15 00:30:20 -04:00
|
|
|
import funkin.ui.story.StoryMenuState;
|
2023-04-16 15:33:20 -04:00
|
|
|
import funkin.graphics.adobeanimate.FlxAtlasSprite;
|
2022-09-20 02:16:12 -04:00
|
|
|
import flixel.FlxSprite;
|
2024-02-22 18:55:24 -05:00
|
|
|
import funkin.graphics.FunkinSprite;
|
2022-12-02 21:37:07 -05:00
|
|
|
import flixel.graphics.frames.FlxBitmapFont;
|
2022-09-22 16:21:31 -04:00
|
|
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
2022-12-02 21:37:07 -05:00
|
|
|
import flixel.math.FlxPoint;
|
2023-11-07 04:04:22 -05:00
|
|
|
import funkin.ui.MusicBeatSubState;
|
2022-12-07 02:29:48 -05:00
|
|
|
import flixel.math.FlxRect;
|
2022-12-02 21:37:07 -05:00
|
|
|
import flixel.text.FlxBitmapText;
|
2022-09-21 18:00:43 -04:00
|
|
|
import flixel.tweens.FlxEase;
|
2023-11-07 04:04:22 -05:00
|
|
|
import funkin.ui.freeplay.FreeplayState;
|
2022-09-21 18:00:43 -04:00
|
|
|
import flixel.tweens.FlxTween;
|
2024-03-23 23:38:07 -04:00
|
|
|
import funkin.audio.FunkinSound;
|
2022-09-21 18:00:43 -04:00
|
|
|
import flixel.util.FlxGradient;
|
|
|
|
import flixel.util.FlxTimer;
|
2024-04-01 21:59:53 -04:00
|
|
|
import funkin.save.Save;
|
|
|
|
import funkin.save.Save.SaveScoreData;
|
2023-11-07 04:04:22 -05:00
|
|
|
import funkin.graphics.shaders.LeftMaskShader;
|
|
|
|
import funkin.play.components.TallyCounter;
|
2022-09-20 02:16:12 -04:00
|
|
|
|
2024-03-04 19:03:43 -05:00
|
|
|
/**
|
|
|
|
* The state for the results screen after a song or week is finished.
|
|
|
|
*/
|
2023-06-01 18:52:58 -04:00
|
|
|
class ResultState extends MusicBeatSubState
|
2022-09-20 02:16:12 -04:00
|
|
|
{
|
2023-10-11 17:33:55 -04:00
|
|
|
final params:ResultsStateParams;
|
|
|
|
|
2023-01-22 22:25:45 -05:00
|
|
|
var resultsVariation:ResultVariations;
|
|
|
|
var songName:FlxBitmapText;
|
|
|
|
var difficulty:FlxSprite;
|
|
|
|
|
2024-03-04 19:03:43 -05:00
|
|
|
var maskShaderSongName:LeftMaskShader = new LeftMaskShader();
|
|
|
|
var maskShaderDifficulty:LeftMaskShader = new LeftMaskShader();
|
2023-01-22 22:25:45 -05:00
|
|
|
|
2023-10-11 17:33:55 -04:00
|
|
|
public function new(params:ResultsStateParams)
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.params = params;
|
|
|
|
}
|
|
|
|
|
2023-04-21 17:39:27 -04:00
|
|
|
override function create():Void
|
2023-01-22 22:25:45 -05:00
|
|
|
{
|
2024-04-01 21:59:53 -04:00
|
|
|
/*
|
|
|
|
if (params.scoreData.sick == params.scoreData.totalNotesHit
|
|
|
|
&& params.scoreData.maxCombo == params.scoreData.totalNotesHit) resultsVariation = PERFECT;
|
|
|
|
else if (params.scoreData.missed + params.scoreData.bad + params.scoreData.shit >= params.scoreData.totalNotes * 0.50)
|
|
|
|
resultsVariation = SHIT; // if more than half of your song was missed, bad, or shit notes, you get shit ending!
|
|
|
|
else
|
|
|
|
resultsVariation = NORMAL;
|
|
|
|
*/
|
|
|
|
resultsVariation = NORMAL;
|
2023-01-22 22:25:45 -05:00
|
|
|
|
2024-03-23 23:38:07 -04:00
|
|
|
FunkinSound.playMusic('results$resultsVariation',
|
|
|
|
{
|
|
|
|
startingVolume: 1.0,
|
|
|
|
overrideExisting: true,
|
|
|
|
restartTrack: true,
|
|
|
|
loop: resultsVariation != SHIT
|
|
|
|
});
|
2023-01-22 22:25:45 -05:00
|
|
|
|
|
|
|
// TEMP-ish, just used to sorta "cache" the 3000x3000 image!
|
2024-03-04 19:03:43 -05:00
|
|
|
var cacheBullShit:FlxSprite = new FlxSprite().loadGraphic(Paths.image("resultScreen/soundSystem"));
|
2023-01-22 22:25:45 -05:00
|
|
|
add(cacheBullShit);
|
|
|
|
|
2024-03-04 19:03:43 -05:00
|
|
|
var dumb:FlxSprite = new FlxSprite().loadGraphic(Paths.image("resultScreen/scorePopin"));
|
2023-01-22 22:25:45 -05:00
|
|
|
add(dumb);
|
|
|
|
|
|
|
|
var bg:FlxSprite = FlxGradient.createGradientFlxSprite(FlxG.width, FlxG.height, [0xFFFECC5C, 0xFFFDC05C], 90);
|
|
|
|
bg.scrollFactor.set();
|
|
|
|
add(bg);
|
|
|
|
|
2024-03-04 19:03:43 -05:00
|
|
|
var bgFlash:FlxSprite = FlxGradient.createGradientFlxSprite(FlxG.width, FlxG.height, [0xFFFFEB69, 0xFFFFE66A], 90);
|
2023-04-17 11:02:45 -04:00
|
|
|
bgFlash.scrollFactor.set();
|
|
|
|
bgFlash.visible = false;
|
|
|
|
add(bgFlash);
|
|
|
|
|
2023-04-16 15:33:20 -04:00
|
|
|
var bfGfExcellent:FlxAtlasSprite = new FlxAtlasSprite(380, -170, Paths.animateAtlas("resultScreen/resultsBoyfriendExcellent", "shared"));
|
|
|
|
bfGfExcellent.visible = false;
|
|
|
|
add(bfGfExcellent);
|
2023-04-17 11:02:45 -04:00
|
|
|
|
2023-04-19 04:08:03 -04:00
|
|
|
var bfPerfect:FlxAtlasSprite = new FlxAtlasSprite(370, -180, Paths.animateAtlas("resultScreen/resultsBoyfriendPerfect", "shared"));
|
|
|
|
bfPerfect.visible = false;
|
|
|
|
add(bfPerfect);
|
|
|
|
|
2023-04-17 11:02:45 -04:00
|
|
|
var bfSHIT:FlxAtlasSprite = new FlxAtlasSprite(0, 20, Paths.animateAtlas("resultScreen/resultsBoyfriendSHIT", "shared"));
|
|
|
|
bfSHIT.visible = false;
|
|
|
|
add(bfSHIT);
|
|
|
|
|
2023-04-21 17:39:27 -04:00
|
|
|
bfGfExcellent.anim.onComplete = () -> {
|
|
|
|
bfGfExcellent.anim.curFrame = 28;
|
|
|
|
bfGfExcellent.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!
|
|
|
|
};
|
|
|
|
|
|
|
|
bfSHIT.anim.onComplete = () -> {
|
|
|
|
bfSHIT.anim.curFrame = 150;
|
|
|
|
bfSHIT.anim.play(); // unpauses this anim, since it's on PlayOnce!
|
|
|
|
};
|
2023-04-16 15:33:20 -04:00
|
|
|
|
2024-02-22 18:55:24 -05:00
|
|
|
var gf:FlxSprite = FunkinSprite.createSparrow(500, 300, 'resultScreen/resultGirlfriendGOOD');
|
2023-01-22 22:25:45 -05:00
|
|
|
gf.animation.addByPrefix("clap", "Girlfriend Good Anim", 24, false);
|
|
|
|
gf.visible = false;
|
2023-04-16 15:33:20 -04:00
|
|
|
gf.animation.finishCallback = _ -> {
|
2023-01-22 22:25:45 -05:00
|
|
|
gf.animation.play('clap', true, false, 9);
|
|
|
|
};
|
|
|
|
add(gf);
|
|
|
|
|
2024-02-22 18:55:24 -05:00
|
|
|
var boyfriend:FlxSprite = FunkinSprite.createSparrow(640, -200, 'resultScreen/resultBoyfriendGOOD');
|
2024-03-25 21:09:14 -04:00
|
|
|
boyfriend.animation.addByPrefix("fall", "Boyfriend Good Anim0", 24, false);
|
2023-01-22 22:25:45 -05:00
|
|
|
boyfriend.visible = false;
|
2023-04-16 15:33:20 -04:00
|
|
|
boyfriend.animation.finishCallback = function(_) {
|
2023-01-22 22:25:45 -05:00
|
|
|
boyfriend.animation.play('fall', true, false, 14);
|
|
|
|
};
|
|
|
|
|
|
|
|
add(boyfriend);
|
|
|
|
|
2024-02-22 18:55:24 -05:00
|
|
|
var soundSystem:FlxSprite = FunkinSprite.createSparrow(-15, -180, 'resultScreen/soundSystem');
|
2023-01-22 22:25:45 -05:00
|
|
|
soundSystem.animation.addByPrefix("idle", "sound system", 24, false);
|
|
|
|
soundSystem.visible = false;
|
2023-04-16 15:33:20 -04:00
|
|
|
new FlxTimer().start(0.4, _ -> {
|
2023-01-22 22:25:45 -05:00
|
|
|
soundSystem.animation.play("idle");
|
|
|
|
soundSystem.visible = true;
|
|
|
|
});
|
|
|
|
add(soundSystem);
|
|
|
|
|
|
|
|
difficulty = new FlxSprite(555);
|
|
|
|
|
2023-06-06 17:38:31 -04:00
|
|
|
var diffSpr:String = switch (PlayState.instance.currentDifficulty)
|
2023-01-22 22:25:45 -05:00
|
|
|
{
|
2024-04-01 21:59:53 -04:00
|
|
|
case 'easy':
|
2023-06-06 17:38:31 -04:00
|
|
|
'difEasy';
|
2024-04-01 21:59:53 -04:00
|
|
|
case 'normal':
|
2023-06-06 17:38:31 -04:00
|
|
|
'difNormal';
|
2024-04-01 21:59:53 -04:00
|
|
|
case 'hard':
|
2023-06-06 17:38:31 -04:00
|
|
|
'difHard';
|
2024-04-01 21:59:53 -04:00
|
|
|
case 'erect':
|
|
|
|
'difErect';
|
|
|
|
case 'nightmare':
|
|
|
|
'difNightmare';
|
2023-01-22 22:25:45 -05:00
|
|
|
case _:
|
2023-06-06 17:38:31 -04:00
|
|
|
'difNormal';
|
2023-01-22 22:25:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
difficulty.loadGraphic(Paths.image("resultScreen/" + diffSpr));
|
|
|
|
add(difficulty);
|
|
|
|
|
|
|
|
var fontLetters:String = "AaBbCcDdEeFfGgHhiIJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz:1234567890";
|
|
|
|
songName = new FlxBitmapText(FlxBitmapFont.fromMonospace(Paths.image("resultScreen/tardlingSpritesheet"), fontLetters, FlxPoint.get(49, 62)));
|
2023-10-11 17:33:55 -04:00
|
|
|
songName.text = params.title;
|
2023-01-22 22:25:45 -05:00
|
|
|
songName.letterSpacing = -15;
|
|
|
|
songName.angle = -4.1;
|
|
|
|
add(songName);
|
|
|
|
|
|
|
|
timerThenSongName();
|
|
|
|
|
|
|
|
songName.shader = maskShaderSongName;
|
|
|
|
difficulty.shader = maskShaderDifficulty;
|
|
|
|
|
|
|
|
// maskShaderSongName.swagMaskX = difficulty.x - 15;
|
|
|
|
maskShaderDifficulty.swagMaskX = difficulty.x - 15;
|
|
|
|
|
|
|
|
var blackTopBar:FlxSprite = new FlxSprite().loadGraphic(Paths.image("resultScreen/topBarBlack"));
|
|
|
|
blackTopBar.y = -blackTopBar.height;
|
|
|
|
FlxTween.tween(blackTopBar, {y: 0}, 0.4, {ease: FlxEase.quartOut, startDelay: 0.5});
|
|
|
|
add(blackTopBar);
|
|
|
|
|
2024-02-22 18:55:24 -05:00
|
|
|
var resultsAnim:FunkinSprite = FunkinSprite.createSparrow(-200, -10, "resultScreen/results");
|
2024-03-25 21:09:14 -04:00
|
|
|
resultsAnim.animation.addByPrefix("result", "results instance 1", 24, false);
|
2023-01-22 22:25:45 -05:00
|
|
|
resultsAnim.animation.play("result");
|
|
|
|
add(resultsAnim);
|
|
|
|
|
2024-02-22 18:55:24 -05:00
|
|
|
var ratingsPopin:FunkinSprite = FunkinSprite.createSparrow(-150, 120, "resultScreen/ratingsPopin");
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingsPopin.animation.addByPrefix("idle", "Categories", 24, false);
|
|
|
|
ratingsPopin.visible = false;
|
|
|
|
add(ratingsPopin);
|
|
|
|
|
2024-02-22 18:55:24 -05:00
|
|
|
var scorePopin:FunkinSprite = FunkinSprite.createSparrow(-180, 520, "resultScreen/scorePopin");
|
2023-01-22 22:25:45 -05:00
|
|
|
scorePopin.animation.addByPrefix("score", "tally score", 24, false);
|
|
|
|
scorePopin.visible = false;
|
|
|
|
add(scorePopin);
|
|
|
|
|
|
|
|
var highscoreNew:FlxSprite = new FlxSprite(280, 580);
|
|
|
|
highscoreNew.frames = Paths.getSparrowAtlas("resultScreen/highscoreNew");
|
|
|
|
highscoreNew.animation.addByPrefix("new", "NEW HIGHSCORE", 24);
|
|
|
|
highscoreNew.visible = false;
|
|
|
|
highscoreNew.setGraphicSize(Std.int(highscoreNew.width * 0.8));
|
|
|
|
highscoreNew.updateHitbox();
|
|
|
|
add(highscoreNew);
|
|
|
|
|
|
|
|
var hStuf:Int = 50;
|
|
|
|
|
|
|
|
var ratingGrp:FlxTypedGroup<TallyCounter> = new FlxTypedGroup<TallyCounter>();
|
|
|
|
add(ratingGrp);
|
|
|
|
|
2024-03-04 20:47:23 -05:00
|
|
|
/**
|
|
|
|
* NOTE: We display how many notes were HIT, not how many notes there were in total.
|
|
|
|
*
|
|
|
|
*/
|
2024-04-01 21:59:53 -04:00
|
|
|
var totalHit:TallyCounter = new TallyCounter(375, hStuf * 3, params.scoreData.tallies.totalNotesHit);
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingGrp.add(totalHit);
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
var maxCombo:TallyCounter = new TallyCounter(375, hStuf * 4, params.scoreData.tallies.maxCombo);
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingGrp.add(maxCombo);
|
|
|
|
|
|
|
|
hStuf += 2;
|
|
|
|
var extraYOffset:Float = 5;
|
2024-04-01 21:59:53 -04:00
|
|
|
var tallySick:TallyCounter = new TallyCounter(230, (hStuf * 5) + extraYOffset, params.scoreData.tallies.sick, 0xFF89E59E);
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingGrp.add(tallySick);
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
var tallyGood:TallyCounter = new TallyCounter(210, (hStuf * 6) + extraYOffset, params.scoreData.tallies.good, 0xFF89C9E5);
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingGrp.add(tallyGood);
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
var tallyBad:TallyCounter = new TallyCounter(190, (hStuf * 7) + extraYOffset, params.scoreData.tallies.bad, 0xFFE6CF8A);
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingGrp.add(tallyBad);
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
var tallyShit:TallyCounter = new TallyCounter(220, (hStuf * 8) + extraYOffset, params.scoreData.tallies.shit, 0xFFE68C8A);
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingGrp.add(tallyShit);
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
var tallyMissed:TallyCounter = new TallyCounter(260, (hStuf * 9) + extraYOffset, params.scoreData.tallies.missed, 0xFFC68AE6);
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingGrp.add(tallyMissed);
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
var score:TallyCounter = new TallyCounter(825, 630, params.scoreData.score, RIGHT);
|
|
|
|
score.scale.set(2, 2);
|
|
|
|
ratingGrp.add(score);
|
|
|
|
|
2023-01-22 22:25:45 -05:00
|
|
|
for (ind => rating in ratingGrp.members)
|
|
|
|
{
|
|
|
|
rating.visible = false;
|
2023-04-16 15:33:20 -04:00
|
|
|
new FlxTimer().start((0.3 * ind) + 0.55, _ -> {
|
2023-01-22 22:25:45 -05:00
|
|
|
rating.visible = true;
|
|
|
|
FlxTween.tween(rating, {curNumber: rating.neededNumber}, 0.5, {ease: FlxEase.quartOut});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-04-16 15:33:20 -04:00
|
|
|
new FlxTimer().start(0.5, _ -> {
|
2023-01-22 22:25:45 -05:00
|
|
|
ratingsPopin.animation.play("idle");
|
|
|
|
ratingsPopin.visible = true;
|
|
|
|
|
2023-04-16 15:33:20 -04:00
|
|
|
ratingsPopin.animation.finishCallback = anim -> {
|
2023-01-22 22:25:45 -05:00
|
|
|
scorePopin.animation.play("score");
|
|
|
|
scorePopin.visible = true;
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
if (params.isNewHighscore)
|
|
|
|
{
|
|
|
|
highscoreNew.visible = true;
|
|
|
|
highscoreNew.animation.play("new");
|
|
|
|
FlxTween.tween(highscoreNew, {y: highscoreNew.y + 10}, 0.8, {ease: FlxEase.quartOut});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
highscoreNew.visible = false;
|
|
|
|
}
|
2023-01-22 22:25:45 -05:00
|
|
|
};
|
|
|
|
|
2023-04-16 18:57:18 -04:00
|
|
|
switch (resultsVariation)
|
2023-01-22 22:25:45 -05:00
|
|
|
{
|
2023-04-17 11:02:45 -04:00
|
|
|
case SHIT:
|
|
|
|
bfSHIT.visible = true;
|
|
|
|
bfSHIT.playAnimation("");
|
|
|
|
|
2023-04-16 18:57:18 -04:00
|
|
|
case NORMAL:
|
|
|
|
boyfriend.animation.play('fall');
|
|
|
|
boyfriend.visible = true;
|
|
|
|
|
2023-04-17 11:02:45 -04:00
|
|
|
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;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2023-04-16 18:57:18 -04:00
|
|
|
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:
|
2023-04-19 04:08:03 -04:00
|
|
|
bfPerfect.visible = true;
|
|
|
|
bfPerfect.playAnimation("");
|
|
|
|
|
|
|
|
// bfGfExcellent.visible = true;
|
|
|
|
// bfGfExcellent.playAnimation("");
|
2023-04-16 18:57:18 -04:00
|
|
|
default:
|
2023-04-16 15:33:20 -04:00
|
|
|
}
|
2023-01-22 22:25:45 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
super.create();
|
|
|
|
}
|
|
|
|
|
2024-03-04 19:03:43 -05:00
|
|
|
function timerThenSongName():Void
|
2023-01-22 22:25:45 -05:00
|
|
|
{
|
|
|
|
movingSongStuff = false;
|
|
|
|
|
|
|
|
difficulty.x = 555;
|
|
|
|
|
2024-03-04 19:03:43 -05:00
|
|
|
var diffYTween:Float = 122;
|
2023-01-22 22:25:45 -05:00
|
|
|
|
|
|
|
difficulty.y = -difficulty.height;
|
|
|
|
FlxTween.tween(difficulty, {y: diffYTween}, 0.5, {ease: FlxEase.quartOut, startDelay: 0.8});
|
|
|
|
|
|
|
|
songName.y = diffYTween - 30;
|
|
|
|
songName.x = (difficulty.x + difficulty.width) + 20;
|
2022-12-07 02:29:48 -05:00
|
|
|
|
2023-04-16 15:33:20 -04:00
|
|
|
new FlxTimer().start(3, _ -> {
|
2023-01-22 22:25:45 -05:00
|
|
|
movingSongStuff = true;
|
|
|
|
});
|
|
|
|
}
|
2022-12-02 21:37:07 -05:00
|
|
|
|
2023-01-22 22:25:45 -05:00
|
|
|
var movingSongStuff:Bool = false;
|
|
|
|
var speedOfTween:FlxPoint = FlxPoint.get(-1, 0.1);
|
2022-12-02 21:37:07 -05:00
|
|
|
|
2023-01-22 22:25:45 -05:00
|
|
|
override function draw():Void
|
|
|
|
{
|
|
|
|
super.draw();
|
2022-09-20 02:16:12 -04:00
|
|
|
|
2023-01-22 22:25:45 -05:00
|
|
|
if (songName != null)
|
|
|
|
{
|
|
|
|
songName.clipRect = FlxRect.get(Math.max(0, 540 - songName.x), 0, FlxG.width, songName.height);
|
|
|
|
// PROBABLY SHOULD FIX MEMORY FREE OR WHATEVER THE PUT() FUNCTION DOES !!!! FEELS LIKE IT STUTTERS!!!
|
|
|
|
}
|
|
|
|
|
|
|
|
// if (songName != null && songName.frame != null)
|
|
|
|
// maskShaderSongName.frameUV = songName.frame.uv;
|
|
|
|
}
|
|
|
|
|
2024-03-04 19:03:43 -05:00
|
|
|
override function update(elapsed:Float):Void
|
2023-01-22 22:25:45 -05:00
|
|
|
{
|
|
|
|
// maskShaderSongName.swagSprX = songName.x;
|
|
|
|
maskShaderDifficulty.swagSprX = difficulty.x;
|
|
|
|
|
|
|
|
if (movingSongStuff)
|
|
|
|
{
|
|
|
|
songName.x += speedOfTween.x;
|
|
|
|
difficulty.x += speedOfTween.x;
|
|
|
|
songName.y += speedOfTween.y;
|
|
|
|
difficulty.y += speedOfTween.y;
|
|
|
|
|
|
|
|
if (songName.x + songName.width < 100)
|
|
|
|
{
|
|
|
|
timerThenSongName();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (FlxG.keys.justPressed.RIGHT) speedOfTween.x += 0.1;
|
|
|
|
|
|
|
|
if (FlxG.keys.justPressed.LEFT)
|
|
|
|
{
|
|
|
|
speedOfTween.x -= 0.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (FlxG.keys.justPressed.UP) speedOfTween.y -= 0.1;
|
|
|
|
|
|
|
|
if (FlxG.keys.justPressed.DOWN) speedOfTween.y += 0.1;
|
|
|
|
|
|
|
|
if (FlxG.keys.justPressed.PERIOD) songName.angle += 0.1;
|
|
|
|
|
|
|
|
if (FlxG.keys.justPressed.COMMA) songName.angle -= 0.1;
|
|
|
|
|
2023-06-15 00:30:20 -04:00
|
|
|
if (controls.PAUSE)
|
|
|
|
{
|
2024-03-06 02:56:10 -05:00
|
|
|
FlxTween.tween(FlxG.sound.music, {volume: 0}, 0.8);
|
2024-03-23 23:38:07 -04:00
|
|
|
FlxTween.tween(FlxG.sound.music, {pitch: 3}, 0.1,
|
|
|
|
{
|
|
|
|
onComplete: _ -> {
|
|
|
|
FlxTween.tween(FlxG.sound.music, {pitch: 0.5}, 0.4);
|
|
|
|
}
|
|
|
|
});
|
2023-10-11 17:33:55 -04:00
|
|
|
if (params.storyMode)
|
2023-06-15 00:30:20 -04:00
|
|
|
{
|
2024-02-13 01:38:11 -05:00
|
|
|
openSubState(new funkin.ui.transition.StickerSubState(null, (sticker) -> new StoryMenuState(sticker)));
|
2023-06-15 00:30:20 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-02-13 01:38:11 -05:00
|
|
|
openSubState(new funkin.ui.transition.StickerSubState(null, (sticker) -> new FreeplayState(null, sticker)));
|
2023-06-15 00:30:20 -04:00
|
|
|
}
|
|
|
|
}
|
2023-01-22 22:25:45 -05:00
|
|
|
|
|
|
|
super.update(elapsed);
|
|
|
|
}
|
2022-09-20 02:16:12 -04:00
|
|
|
}
|
2022-09-20 13:18:40 -04:00
|
|
|
|
|
|
|
enum abstract ResultVariations(String)
|
|
|
|
{
|
2023-01-22 22:25:45 -05:00
|
|
|
var PERFECT;
|
2023-04-19 04:08:03 -04:00
|
|
|
var EXCELLENT;
|
2023-01-22 22:25:45 -05:00
|
|
|
var NORMAL;
|
|
|
|
var SHIT;
|
2022-09-20 13:18:40 -04:00
|
|
|
}
|
2023-10-11 17:33:55 -04:00
|
|
|
|
|
|
|
typedef ResultsStateParams =
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* True if results are for a level, false if results are for a single song.
|
|
|
|
*/
|
|
|
|
var storyMode:Bool;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Either "Song Name by Artist Name" or "Week Name"
|
|
|
|
*/
|
|
|
|
var title:String;
|
|
|
|
|
2024-04-01 21:59:53 -04:00
|
|
|
/**
|
|
|
|
* Whether the displayed score is a new highscore
|
|
|
|
*/
|
|
|
|
var isNewHighscore:Bool;
|
|
|
|
|
2023-10-11 17:33:55 -04:00
|
|
|
/**
|
|
|
|
* The score, accuracy, and judgements.
|
|
|
|
*/
|
2024-04-01 21:59:53 -04:00
|
|
|
var scoreData:SaveScoreData;
|
2023-10-11 17:33:55 -04:00
|
|
|
};
|