Exemple #1
0
    IEnumerator PlayGameRoutine()
    {
        if (m_levelGoal.levelCounter == LevelCounter.Timer)
        {
            m_levelGoal.StartCountdown();
        }

        while (!m_isGameOver)
        {
            m_isGameOver = m_levelGoal.IsGameOver();

            m_isWinner = m_levelGoal.IsWinner();

            yield return(null);
        }
    }
Exemple #2
0
  IEnumerator PlayGameRoutine()
  {
      if (m_levelGoal.levelCounter == LevelCounter.Timer)
      {
          m_levelGoal.StartCountdown();       //it runs every level uses timer.
      }


      while (!m_isGameOver)
      {
          m_isGameOver = m_levelGoal.IsGameOver();
          m_isWinner   = m_levelGoal.IsWinner();

          //wait one frame
          yield return(null);
      }
  }
Exemple #3
0
    // coroutine for game play
    IEnumerator PlayGameRoutine()
    {
        // if level is timed, start the timer
        if (m_levelGoal.levelCounter == LevelCounter.Timer)
        {
            m_levelGoal.StartCountdown();
        }
        // while the end game condition is not true, we keep playing
        // just keep waiting one frame and checking for game conditions
        while (!m_isGameOver)
        {
            m_isGameOver = m_levelGoal.IsGameOver();

            m_isWinner = m_levelGoal.IsWinner();

            // wait one frame
            yield return(null);
        }
    }
Exemple #4
0
    IEnumerator PlayGameRoutine()
    {
        if (IsTimedLevel())
        {
            levelGoal.StartCountdown();
        }

        while (!isGameOver)
        {
            if (isPaused)
            {
                yield return(StartCoroutine(SettingsMenuRoutine()));
            }
            isGameOver = levelGoal.IsGameOver();
            isWinner   = levelGoal.IsWinner();

            yield return(null);
        }
    }
Exemple #5
0
    IEnumerator PlayGameRoutine()
    {
        if (m_levelGoal.levelCounter == LevelCounter.Timer)
        {
            m_levelGoal.StartCountdown();
        }

        while (!m_isGameOver)
        {
            m_isGameOver = m_levelGoal.IsGameOver();

            yield return(null);
        }

        if (m_levelGoal.levelCounter == LevelCounter.Timer)
        {
            m_levelGoal.StopCountdown();
        }

        yield return(StartCoroutine(WaitForBoardRoutine(0.5f)));

        m_isWinner = m_levelGoal.IsWinner();
    }