Skip to content

Commit

Permalink
did a thing for the results screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored May 30, 2024
1 parent 56f3da7 commit 54cd3bf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
12 changes: 6 additions & 6 deletions source/meta/substate/PasswordPrompt.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ class PasswordPrompt extends meta.MusicBeatSubstate
input.setBorderStyle(OUTLINE, 0xFF000000, 5, 1);
input.screenCenter();
input.y += 50;
input.scrollFactor.set();
input.scrollFactor.set();
add(black);
add(txt);
add(input);
input.backgroundColor = 0xFF000000;
input.maxLength = 15;
input.lines = 1;
input.caretColor = 0xFFFFFFFF;
input.backgroundColor = 0xFF000000;
input.maxLength = 15;
input.lines = 1;
input.caretColor = 0xFFFFFFFF;
FlxG.mouse.visible = true;
}

override function update(elapsed:Float)
{
super.update(elapsed);
input.hasFocus = true;
input.hasFocus = true;

if (controls.ACCEPT) { // add custom functions here
FlxG.mouse.visible = false;
Expand Down
38 changes: 31 additions & 7 deletions source/meta/substate/ResultsSubState.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package meta.substate;

// TO-DO: add rating sprites based on rating
class ResultsSubState extends MusicBeatSubstate
{
var titleTxt:FlxText;
Expand All @@ -17,6 +18,8 @@ class ResultsSubState extends MusicBeatSubstate
var rating:String;
var fc:String;

var fcSprite:FlxSprite;

public function new(sicks:Int, goods:Int, bads:Int, shits:Int, score:Int, misses:Int, percent:Float, rating:String, fc:String)
{
super();
Expand All @@ -43,10 +46,31 @@ class ResultsSubState extends MusicBeatSubstate
bg.scrollFactor.set();
add(bg);

var versionShit:FlxText = new FlxText(12, FlxG.height - 24, 0, 'Press ACCEPT to continue.', 12);
versionShit.scrollFactor.set();
versionShit.setFormat("VCR OSD Mono", 26, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(versionShit);
var hint:FlxText = new FlxText(12, FlxG.height - 24, 0, 'You passed, but try getting under 10 misses for SDCB.', 12);
hint.scrollFactor.set();
hint.setFormat("VCR OSD Mono", 26, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(hint);

switch (fc)
{
case 'SDCB':
hint.text = 'Nice, but try not to miss at all for FC.';
case 'FC':
hint.text = 'Good job, but try getting bads at minimum for GFC.';
case 'GFC':
hint.text = 'You\'re getting there. Try getting goods at minimum for MFC.'
case 'MFC':
hint.text = 'Almost there! Try getting only sicks for SFC!';
case 'SFC':
hint.text = 'You did it! You\'re perfect!';
case 'WTF??':
hint.text = '...You suck.';
case 'Cheater!' | 'BotPlay':
hint.text = 'If you want something, disable Botplay.';
}

if (PlayState.practiceMode)
hint.text = 'You did good, but you used practice mode. So you don\'t really get anything.';

titleTxt = new FlxText(0, 0, 0, 'RESULTS', 72);
titleTxt.scrollFactor.set();
Expand All @@ -72,15 +96,15 @@ class ResultsSubState extends MusicBeatSubstate
resultsTxt.updateHitbox();
add(resultsTxt);

versionShit.alpha = 0;
hint.alpha = 0;
resultsTxt.alpha = 0;
titleTxt.alpha = 0;
bg.alpha = 0;

FlxTween.tween(bg, {alpha: 0.55}, 0.75, {ease: FlxEase.quadOut});
FlxTween.tween(titleTxt, {alpha: 1}, 1, {ease: FlxEase.quadOut});
FlxTween.tween(resultsTxt, {alpha: 1}, 2, {ease: FlxEase.quadOut});
FlxTween.tween(versionShit, {alpha: 1}, 3, {ease: FlxEase.quadOut});
FlxTween.tween(hint, {alpha: 1}, 3, {ease: FlxEase.quadOut});

super.create();

Expand All @@ -91,7 +115,7 @@ class ResultsSubState extends MusicBeatSubstate
{
super.update(elapsed);

if (controls.ACCEPT)
if (FlxG.keys.justPressed.ANY)
{
if (PlayState.isStoryMode)
FlxG.switchState(() -> new StoryMenuState());
Expand Down

0 comments on commit 54cd3bf

Please sign in to comment.