void Awake() { SP = this; gameState = PinballGameState.playing; Time.timeScale = 1.0f; SpawnBall(); }
void Awake() { SP = this; gameState = PinballGameState.playing; Time.timeScale = 1.0f; SpawnBall(); SetNewTime(); SetScoreText(); winText.text = ""; }
public void LostBall() { int ballsLeft = GameObject.FindGameObjectsWithTag("Player").Length; if (ballsLeft <= 1) { //Was the last ball.. //SetGameOver(); gameState = PinballGameState.lost; } }
void Awake() { // Save pause menu object and hide pauseMenu = GameObject.Find ("Pause Panel"); pauseMenu.SetActive(false); numObjects = GameObject.FindGameObjectsWithTag ("Bumper").Length; SP = this; gameState = PinballGameState.playing; Time.timeScale = 1.0f; SpawnBall(); }
void SetScoreText() { scoreCount.text = "Score: " + score.ToString(); if (score == 2000) { winText.text = "YOU WIN!"; gameState = PinballGameState.won; StartCoroutine("wait"); } if (gameState == PinballGameState.lost) { winText.text = "YOU LOSE!"; StartCoroutine("wait"); } }
public void SetGameOver() { Time.timeScale = 0.0f; //Pause game gameState = PinballGameState.lost; }
public void WonGame() { Time.timeScale = 0.0f; //Pause game gameState = PinballGameState.won; }