1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-25 14:46:43 +00:00

Merge pull request #512 from FunkinCrew/bugfix/results-fixins

Bugfix/results fixins
This commit is contained in:
Cameron Taylor 2024-04-25 01:56:16 -04:00 committed by GitHub
commit 2c17fcd90c
2 changed files with 36 additions and 27 deletions

View file

@ -3020,23 +3020,30 @@ class PlayState extends MusicBeatSubState
if (targetBF) if (targetBF)
{ {
FlxG.camera.follow(currentStage.getBoyfriend(), null, 0.05); FlxG.camera.follow(currentStage.getBoyfriend(), null, 0.05);
FlxG.camera.targetOffset.y -= 350;
FlxG.camera.targetOffset.x += 20;
} }
else if (targetDad) else if (targetDad)
{ {
FlxG.camera.follow(currentStage.getDad(), null, 0.05); FlxG.camera.follow(currentStage.getDad(), null, 0.05);
FlxG.camera.targetOffset.y -= 350;
FlxG.camera.targetOffset.x += 20;
} }
else else
{ {
FlxG.camera.follow(currentStage.getGirlfriend(), null, 0.05); FlxG.camera.follow(currentStage.getGirlfriend(), null, 0.05);
FlxG.camera.targetOffset.y -= 350;
FlxG.camera.targetOffset.x += 20;
} }
FlxTween.tween(camHUD, {alpha: 0}, 0.6); // TODO: Make target offset configurable.
// In the meantime, we have to replace the zoom animation with a fade out.
FlxG.camera.targetOffset.y -= 350;
FlxG.camera.targetOffset.x += 20;
// Replace zoom animation with a fade out for now.
camGame.fade(FlxColor.BLACK, 0.6);
FlxTween.tween(camHUD, {alpha: 0}, 0.6,
{
onComplete: function(_) {
moveToResultsScreen(isNewHighscore);
}
});
// Zoom in on Girlfriend (or BF if no GF) // Zoom in on Girlfriend (or BF if no GF)
new FlxTimer().start(0.8, function(_) { new FlxTimer().start(0.8, function(_) {
@ -3054,13 +3061,13 @@ class PlayState extends MusicBeatSubState
} }
// Zoom over to the Results screen. // Zoom over to the Results screen.
// TODO: Re-enable this.
/*
FlxTween.tween(FlxG.camera, {zoom: 1200}, 1.1, FlxTween.tween(FlxG.camera, {zoom: 1200}, 1.1,
{ {
ease: FlxEase.expoIn, ease: FlxEase.expoIn,
onComplete: function(_) {
moveToResultsScreen(isNewHighscore);
}
}); });
*/
}); });
} }
@ -3247,7 +3254,7 @@ class PlayState extends MusicBeatSubState
SongEventRegistry.handleSkippedEvents(songEvents, Conductor.instance.songPosition); SongEventRegistry.handleSkippedEvents(songEvents, Conductor.instance.songPosition);
// regenNoteData(FlxG.sound.music.time); // regenNoteData(FlxG.sound.music.time);
Conductor.instance.update(FlxG.sound.music.time); Conductor.instance.update(FlxG.sound?.music?.time ?? 0.0);
resyncVocals(); resyncVocals();
} }

View file

@ -161,9 +161,13 @@ class ResultState extends MusicBeatSubState
songName = new FlxBitmapText(FlxBitmapFont.fromMonospace(Paths.image("resultScreen/tardlingSpritesheet"), fontLetters, FlxPoint.get(49, 62))); songName = new FlxBitmapText(FlxBitmapFont.fromMonospace(Paths.image("resultScreen/tardlingSpritesheet"), fontLetters, FlxPoint.get(49, 62)));
songName.text = params.title; songName.text = params.title;
songName.letterSpacing = -15; songName.letterSpacing = -15;
songName.angle = -4.1; songName.angle = -4.4;
add(songName); add(songName);
var angleRad = songName.angle * Math.PI / 180;
speedOfTween.x = -1.0 * Math.cos(angleRad);
speedOfTween.y = -1.0 * Math.sin(angleRad);
timerThenSongName(); timerThenSongName();
songName.shader = maskShaderSongName; songName.shader = maskShaderSongName;
@ -317,18 +321,24 @@ class ResultState extends MusicBeatSubState
var diffYTween:Float = 122; var diffYTween:Float = 122;
difficulty.y = -difficulty.height; difficulty.y = -difficulty.height;
FlxTween.tween(difficulty, {y: diffYTween}, 0.5, {ease: FlxEase.quartOut, startDelay: 0.8}); FlxTween.tween(difficulty, {y: diffYTween}, 0.5, {ease: FlxEase.expoOut, startDelay: 0.8});
songName.y = diffYTween - 30; songName.y = -songName.height;
FlxTween.tween(songName, {y: diffYTween - 35}, 0.5, {ease: FlxEase.expoOut, startDelay: 0.9});
songName.x = (difficulty.x + difficulty.width) + 20; songName.x = (difficulty.x + difficulty.width) + 20;
new FlxTimer().start(3, _ -> { new FlxTimer().start(3, _ -> {
var tempSpeed = FlxPoint.get(speedOfTween.x, speedOfTween.y);
speedOfTween.set(0, 0);
FlxTween.tween(speedOfTween, {x: tempSpeed.x, y: tempSpeed.y}, 0.7, {ease: FlxEase.quadIn});
movingSongStuff = true; movingSongStuff = true;
}); });
} }
var movingSongStuff:Bool = false; var movingSongStuff:Bool = false;
var speedOfTween:FlxPoint = FlxPoint.get(-1, 0.1); var speedOfTween:FlxPoint = FlxPoint.get(-1, 1);
override function draw():Void override function draw():Void
{ {
@ -369,14 +379,6 @@ class ResultState extends MusicBeatSubState
speedOfTween.x -= 0.1; 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;
if (controls.PAUSE) if (controls.PAUSE)
{ {
FlxTween.tween(FlxG.sound.music, {volume: 0}, 0.8); FlxTween.tween(FlxG.sound.music, {volume: 0}, 0.8);