Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (pause.paused)
        {
            return;
        }

        if (gameNotStarted)
        {
            float cdf = Mathf.Ceil((startTime + startDelay) - Time.time);
            int   cd  = (int)cdf;
            countdown.text = cd.ToString();
            if (cd == 0)
            {
                countdown.text = "Go!";
            }
        }

        if (((startTime + startDelay) - Time.time) < -1)
        {
            countdown.text  = "";
            pause.startGame = false;
        }

        rusNumber.text = "0" + rusSwitches.ToString();
        murNumber.text = "0" + ameSwitches.ToString();

        if (Time.time > (startTime + startDelay))
        {
            if (gameNotStarted)
            {
                levelTimer.GameStart();
                gameNotStarted = false;
            }
        }

        if (levelTimer.roundTime <= 0)
        {
            drawPaper.SetActive(true);
            drawAnthem.SetActive(true);
            draw     = true;
            gameOver = true;
            levelTimer.StopTimer();
            gameEndButtons.SetActive(true);
            bg.Victory();
        }
    }
Beispiel #2
0
    void Update()
    {
        if (pause.paused)
        {
            return;
        }

        if (gameStart)
        {
            float cdf = Mathf.Ceil((startTime + startDelay) - Time.time);
            int   cd  = (int)cdf;
            countdown.text = cd.ToString();
            if (cd == 0)
            {
                countdown.text = "Go!";
            }
        }

        if (((startTime + startDelay) - Time.time) < -1)
        {
            countdown.text  = "";
            pause.startGame = false;
        }

        //Set the number to how many of own buttons pressed by enemy
        rusNumber.text = "0" + ameButtonCount.ToString();
        murNumber.text = "0" + rusButtonCount.ToString();

        if (rusButtonCount >= 5 || ameButtonCount >= 5)
        {
            if (rusButtonCount >= 5)
            {
                rusAnthem.SetActive(true);
                ruskieswin.SetActive(true);
            }

            else if (ameButtonCount >= 5)
            {
                ameAnthem.SetActive(true);
                muricawin.SetActive(true);
            }

            gameoveryeh = true;
            levelTimer.StopTimer();
            bg.Victory();
        }
        else if (levelTimer.roundTime <= 0)
        {
            draw = true;
            drawPaper.SetActive(true);
            drawAnthem.SetActive(true);
            gameoveryeh = true;
            levelTimer.StopTimer();
            bg.Victory();
        }

        if (gameoveryeh)
        {
            afterGameButtons.SetActive(true);
        }

        if (Time.time > (startTime + startDelay))
        {
            if (gameStart)
            {
                startBoundaries.SetActive(false);
                levelTimer.GameStart();
                gameStart = false;
            }
        }
    }
Beispiel #3
0
    void Update()
    {
        if (pause.paused)
        {
            return;
        }

        if (gameNotStarted)
        {
            float cdf = Mathf.Ceil((startTime + startDelay) - Time.time);
            int   cd  = (int)cdf;
            countdown.text = cd.ToString();
            if (cd == 0)
            {
                countdown.text = "Go!";
            }
        }

        if (((startTime + startDelay) - Time.time) < -1)
        {
            countdown.text  = "";
            pause.startGame = false;
        }

        emuNumber.text  = emusZoned.ToString();
        tankNumber.text = bulletsZoned.ToString();

        if (levelTimer.roundTime <= 0)
        {
            if (emusZoned > bulletsZoned)
            {
                emuAnthem.SetActive(true);
                emuWinPaper.SetActive(true);
                emuWin = true;
            }
            else if (bulletsZoned > emusZoned)
            {
                ausAnthem.SetActive(true);
                ausWinPaper.SetActive(true);
                ausWin = true;
            }
            else
            {
                draw = true;
                drawPaper.SetActive(true);
                drawAnthem.SetActive(true);
            }

            levelTimer.StopTimer();
            gameOver = true;
            bg.Victory();
            afterGameButtons.SetActive(true);
        }

        if (Time.time > (startTime + startDelay))
        {
            if (gameNotStarted)
            {
                levelTimer.GameStart();
                gameNotStarted = false;
            }
        }
    }