Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgraham committed Sep 16, 2021
1 parent 5e2c98d commit b4655a9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Assets/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ private void LoadLevel(int level)
{
this.level = level;

// Load the win scene if you have beaten all of the levels.
if (level > NUM_LEVELS) {
SceneManager.LoadScene("Winner");
} else {
SceneManager.LoadScene("Level" + level);
if (level > NUM_LEVELS)
{
// Start over again at level 1 once you have beaten all the levels
// You can also load a "Win" scene instead
LoadLevel(1);
return;
}

SceneManager.LoadScene("Level" + level);
}

private void OnLevelLoaded(Scene scene, LoadSceneMode mode)
Expand All @@ -68,15 +71,16 @@ private void ResetLevel()
this.paddle.ResetPaddle();
this.ball.ResetBall();

// Resetting the bricks is optional
// for (int i = 0; i < this.bricks.Length; i++) {
// this.bricks[i].ResetBrick();
// }
}

private void GameOver()
{
// SceneManager.LoadScene("GameOver");

// Start a new game immediately
// You can also load a "GameOver" scene instead
NewGame();
}

Expand Down

0 comments on commit b4655a9

Please sign in to comment.