2022-09-20 02:16:12 -04:00
|
|
|
package funkin.play;
|
|
|
|
|
|
|
|
import flixel.FlxSprite;
|
|
|
|
import flixel.text.FlxText;
|
|
|
|
|
|
|
|
class ResultState extends MusicBeatSubstate
|
|
|
|
{
|
2022-09-20 13:18:40 -04:00
|
|
|
var resultsVariation:ResultVariations;
|
|
|
|
|
2022-09-20 02:16:12 -04:00
|
|
|
override function create()
|
|
|
|
{
|
2022-09-20 13:18:40 -04:00
|
|
|
if (Highscore.tallies.sick == Highscore.tallies.totalNotes && Highscore.tallies.maxCombo == Highscore.tallies.totalNotes)
|
|
|
|
resultsVariation = PERFECT;
|
|
|
|
else if (Highscore.tallies.missed + Highscore.tallies.bad + Highscore.tallies.shit >= Highscore.tallies.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;
|
|
|
|
|
|
|
|
FlxG.sound.playMusic(Paths.music("results" + resultsVariation));
|
2022-09-20 13:01:37 -04:00
|
|
|
|
2022-09-20 02:16:12 -04:00
|
|
|
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, 0xFF000000);
|
2022-09-20 13:01:37 -04:00
|
|
|
bg.alpha = 0.8;
|
2022-09-20 02:16:12 -04:00
|
|
|
bg.scrollFactor.set();
|
|
|
|
add(bg);
|
2022-09-20 02:37:43 -04:00
|
|
|
var results:FlxText = new FlxText(70, 70, 0, "RESULTS:", 32);
|
2022-09-20 02:16:12 -04:00
|
|
|
|
2022-09-20 02:37:43 -04:00
|
|
|
results.text += "\nTOTAL NOTES: ";
|
|
|
|
results.text += Highscore.tallies.totalNotes;
|
2022-09-20 02:16:12 -04:00
|
|
|
results.text += "\nMISSED: ";
|
|
|
|
results.text += Highscore.tallies.missed;
|
|
|
|
results.text += "\nSHIT: ";
|
|
|
|
results.text += Highscore.tallies.shit;
|
|
|
|
results.text += "\nBAD: ";
|
|
|
|
results.text += Highscore.tallies.bad;
|
|
|
|
results.text += "\nGOOD: ";
|
|
|
|
results.text += Highscore.tallies.good;
|
|
|
|
results.text += "\nSICK: ";
|
|
|
|
results.text += Highscore.tallies.sick;
|
|
|
|
results.text += "\nMAX COMBO: ";
|
|
|
|
results.text += Highscore.tallies.maxCombo;
|
|
|
|
add(results);
|
|
|
|
results.scrollFactor.set();
|
|
|
|
|
|
|
|
super.create();
|
|
|
|
}
|
|
|
|
|
|
|
|
override function update(elapsed:Float)
|
|
|
|
{
|
|
|
|
if (controls.PAUSE)
|
|
|
|
FlxG.switchState(new FreeplayState());
|
|
|
|
|
|
|
|
super.update(elapsed);
|
|
|
|
}
|
|
|
|
}
|
2022-09-20 13:18:40 -04:00
|
|
|
|
|
|
|
enum abstract ResultVariations(String)
|
|
|
|
{
|
|
|
|
var PERFECT;
|
|
|
|
var NORMAL;
|
|
|
|
var SHIT;
|
|
|
|
}
|