public virtual void StartMultiplayer()
    {
        MainGameController.ShowHud(true);
        UINavigationController.DismissAllControllers();
        UINavigationController.DismissBackground("/MainBackground");

        MainGameController.StartMultiplayerGame();
    }
    protected virtual void StartGame()
    {
        MainGameController.ShowHud(true);
        UINavigationController.DismissAllControllers();
        UINavigationController.DismissBackground("/MainBackground");

        MainGameController.StartLocalSinglePlayerGame();
    }
Esempio n. 3
0
    public void OnCategorySelected(QAController.QuestionCategory category)
    {
        ShowHud(true);
        UINavigationController.DismissBackground("/MainBackground");
        UINavigationController.DismissAllControllers();
        Debug.Log(category);
        var player = GetCurrentPlayerController();
        int steps  = category == QAController.QuestionCategory.Easy ? 1 : category == QAController.QuestionCategory.Medium ? 2 : 3;

        gameBoard.PlayerHightlightBlock(player, steps);
    }
Esempio n. 4
0
    protected IEnumerator ValidateChoice(int choice)
    {
        _enableTimer = false;
        _counterTime = 0;
        bool isCorrect = false;

        SetButtonEnabled(false);

        List <int> corrects = new List <int>();

        for (int index = 0; index < activeQuestion.answers.Count; index++)
        {
            QuestionData.answer answer = activeQuestion.answers[index];
            if (answer.correct)
            {
                corrects.Add(index);
            }

            if (index == choice && answer.correct && !isCorrect)
            {
                isCorrect = true;
            }
        }

        if (choice < 0)
        {
            isCorrect = false;
        }

        if (isCorrect == false && choice >= 0)
        {
            UIButton button = choices[choice];
            ChangeButtonColor(button, Color.red);
        }

        for (int cIndex = 0; cIndex < corrects.Count; cIndex++)
        {
            int correctIndex = corrects[cIndex];
            ChangeButtonColor(choices[correctIndex], Color.green);
        }

        float waitTime = 3;

        if (activeQuestion != null)
        {
            additionalInfo.text = activeQuestion.info;
            if (activeQuestion.info.Trim() != "")
            {
                waitTime = 6;
            }
        }

        yield return(new WaitForSeconds(waitTime));

        activeQuestion = null;

        UINavigationController.DismissAllControllers();
        UINavigationController.DismissBackground("/MainBackground");
        if (OnChoiceSelected != null)
        {
            OnChoiceSelected(isCorrect);
        }
        //GameBoard.EndTurn(isCorrect);
    }