From bfaa4626f88be1deb3a5af85c2939e3a351b150a Mon Sep 17 00:00:00 2001 From: codist <50346006+ImCodist@users.noreply.github.com> Date: Thu, 9 May 2024 01:10:53 -0400 Subject: [PATCH] Polish for the transition from GameOverSubState back into PlayState. --- source/funkin/play/PlayState.hx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 44ad819c4..8903a4e63 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -826,6 +826,8 @@ class PlayState extends MusicBeatSubState resetCamera(); + var fromDeathState = isPlayerDying; + persistentUpdate = true; persistentDraw = true; @@ -863,8 +865,11 @@ class PlayState extends MusicBeatSubState if (currentStage != null) currentStage.resetStage(); - playerStrumline.vwooshNotes(); - opponentStrumline.vwooshNotes(); + if (!fromDeathState) + { + playerStrumline.vwooshNotes(); + opponentStrumline.vwooshNotes(); + } playerStrumline.clean(); opponentStrumline.clean(); @@ -1075,6 +1080,22 @@ class PlayState extends MusicBeatSubState function moveToGameOver():Void { + // Reset and update a bunch of values in advance for the transition back from the game over substate. + playerStrumline.clean(); + opponentStrumline.clean(); + + songScore = 0; + updateScoreText(); + + health = Constants.HEALTH_STARTING; + healthLerp = health; + + healthBar.value = healthLerp; + + iconP1.updatePosition(); + iconP2.updatePosition(); + + // Transition to the game over substate. var gameOverSubState = new GameOverSubState( { isChartingMode: isChartingMode,