Skip to content

Commit

Permalink
Merge pull request FunkinCrew#2390 from ImCodist/polish/game-over-tra…
Browse files Browse the repository at this point in the history
…nsition

Polish for the transition from GameOverSubState back into PlayState.
  • Loading branch information
ninjamuffin99 authored May 15, 2024
2 parents 86de75f + bfaa462 commit 5e70d9f
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,8 @@ class PlayState extends MusicBeatSubState

resetCamera();

var fromDeathState = isPlayerDying;

persistentUpdate = true;
persistentDraw = true;

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5e70d9f

Please sign in to comment.