Example #1
0
 private void Start()
 {
     Time.timeScale = 0;
     _startScreen.Open();
     _gameOverScreen.Close();
     _highScore.Open();
 }
Example #2
0
 private void OnRestartButtonClick()
 {
     _gameOverScreen.Close();
     _bird.ResetBird();
     _generator.ResetPool();
     Time.timeScale = 1;
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        score           = 0;
        scoreValue.text = score.ToString();

        keysValue.text = "0";

        healthBar.fillAmount = 1;
        healthBar.color      = Color.green;

        optionsPopup.Close();
        settingsPopup.Close();
        door3Popup.Close();
        gameOverScreen.Close();
    }
Example #4
0
    // Use this for initialization
    void Start()
    {
        //close options pop-up on start of game
        settingsPopup.Close();
        optionsPopup.Close();
        doorPopup.Close();
        welcomeScreen.Open();

        score           = 0;
        scoreValue.text = score.ToString();

        _health = 5;
        healthBar.fillAmount = 1.0f;
        healthBar.color      = Color.green;

        gameOverScreen.Close();
    }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        if ((!player1.GetComponent <Jugador>().isAlive || !player2.GetComponent <Jugador>().isAlive) && !roundEnded)
        {
            if (player1.GetComponent <Jugador>().isAlive)
            {
                player1.GetComponent <Jugador>().points++;
            }
            else if (player2.GetComponent <Jugador>().isAlive)
            {
                player2.GetComponent <Jugador>().points++;
            }

            roundEnded = true;
            this.CheckVictory();
        }


        if (roundEnded)
        {
            player1.GetComponent <Jugador>().RestartRound();
            player1.transform.position = pos1.position;
            player2.GetComponent <Jugador>().RestartRound();
            player2.transform.position = pos2.position;
            roundEnded = false;
        }

        if (Input.GetKeyDown("p"))
        {
            paused = !paused;
            if (paused)
            {
                endScreen.Open();
            }
            else
            {
                endScreen.Close();
            }
        }
    }
Example #6
0
 private void Start()
 {
     Time.timeScale = 0f;
     _playScreen.Open();
     _gameOverScreen.Close();
 }
Example #7
0
 private void OnRestartButtonClick()
 {
     _gameOverScreen.Close();
     _wallGenerator.ResetPool();
     StartGame();
 }
Example #8
0
 private void OnRestartButtonClick()
 {
     _gameOverScreen.Close();
     _columnSpawner.ResetPool();
     StartGame();
 }