Exemplo n.º 1
0
 // Restart the game
 // Give the player the lives back
 // Reset the state
 public void RestartGame()
 {
     if (GameState == GameStates.End && Lives <= 0)
     {
         Lives = 3;
     }
     OnGameRestart?.Invoke(GameState);
     Invoke("StartGame", 3);
     GameState = GameStates.Running;
 }
Exemplo n.º 2
0
        public void EndGame()
        {
            inventory.energy.SetValue(0);
            inventory.health.SetValue(0);
            inventory.keyLrg.SetValue(0);
            inventory.keySml.SetValue(0);
            inventory.score.SetValue(0);
            OnGameEnd?.Invoke();

            OnGameRestart?.Invoke();
        }
Exemplo n.º 3
0
 // Restarts the game by reloading the current scene
 /// <summary>
 /// Restarts the game.
 /// </summary>
 public void RestartGame()
 {
     GameOver = false;
     OnGameRestart?.Invoke();
     StartGame();
 }
Exemplo n.º 4
0
 public void Restart()
 {
     HideGameOverScreen();
     OnGameRestart?.Invoke();
 }
Exemplo n.º 5
0
 public void RestartGame()
 {
     isGameOver = false;
     SceneManager.LoadScene("PigGame");
     OnGameRestart?.Invoke();
 }
Exemplo n.º 6
0
 public void OnGameRestart_Event()
 {
     OnGameRestart?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 7
0
 public void Restart()
 {
     OnGameRestart?.Invoke();
 }