Skip to content

Commit

Permalink
fix: endgame ui
Browse files Browse the repository at this point in the history
  • Loading branch information
pyoneerC committed Sep 26, 2024
1 parent 8ee86d1 commit 63a3e67
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Assets/Scripts/UI/Endgame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ private void EndGame(bool isVictory)
if (isVictory)
{
_score = Random.Range(7, 11); // Random score between 7 and 10
endgameText.color = Color.green; // Change text color to green
endgameText.text = "Felicidades!"; // Victory message
}
else
{
_score = 0; // No score for losing
endgameText.text = "Perdiste!"; // Loss message
endgameText.color = Color.red; // Change text color to red
}

// Update the UI elements
Expand All @@ -118,6 +116,12 @@ private void EndGame(bool isVictory)
// Make the text visible
SetTextVisibility(true);
SetExplanationTextVisibility(1f);

endgameText.color = isVictory ? Color.green : // Change text color to green
Color.red; // Change text color to red

scoreText.color = isVictory ? Color.green : // Change text color to green
Color.red; // Change text color to red
}

private void UpdateUI()
Expand Down

0 comments on commit 63a3e67

Please sign in to comment.