void OnPopupCloseRequested()
 {
     if (game.CurrentStars == 3)
     {
         game.SetCurrentState(game.EndState);
     }
     else
     {
         game.SetCurrentState(game.QuestionState);
     }
 }
Example #2
0
        void OnQuestionCompleted()
        {
            if (FastCrowdConfiguration.Instance.NeedsFullQuestionCompleted)
            {
                // In spelling and letter, increment score only when the full question is completed
                for (int i = 0; i < game.CurrentChallenge.Count; ++i)
                {
                    game.IncrementScore();
                }
            }

            if (FastCrowdConfiguration.Instance.Variation == FastCrowdVariation.BuildWord)
            {
                var question = game.CurrentQuestion;

                if (question != null && question.GetQuestion() != null)
                {
                    game.Context.GetLogManager().OnAnswered(question.GetQuestion(), true);
                }
            }

            game.SetCurrentState(game.ResultState);
        }
Example #3
0
        public void Update(float delta)
        {
            if (nextState)
            {
                nextState = false;
                game.SetCurrentState(game.QuestionState);
            }

            if (playIntro)
            {
                playIntro = false;

                if (AppManager.I.AppSettings.EnglishSubtitles)
                {
                    KeeperManager.I.PlayDialog(FastCrowdConfiguration.Instance.IntroLocalizationId, true, true, () => { nextState = true; });
                }
                else
                {
                    game.Context.GetAudioManager().PlayDialogue(FastCrowdConfiguration.Instance.IntroLocalizationId, () => { nextState = true; });
                }
            }
        }
Example #4
0
        public void EnterState()
        {
            if (game.showTutorial)
            {
                game.QuestionManager.crowd.MaxConcurrentLetters = 2;
            }
            else
            {
                game.QuestionManager.crowd.MaxConcurrentLetters = UnityEngine.Mathf.RoundToInt(4 + game.Difficulty * 4);
            }

            // Forced number of letters
            if (FastCrowdConfiguration.Instance.Variation == FastCrowdVariation.CategoryForm)
            {
                game.QuestionManager.crowd.MaxConcurrentLetters = 4;
            }

            game.CurrentChallenge.Clear();
            game.NoiseData.Clear();

            var provider = FastCrowdConfiguration.Instance.Questions;
            var question = provider.GetNextQuestion();

            game.CurrentQuestion = question;

            if (question == null)
            {
                game.SetCurrentState(game.EndState);
                return;
            }

            // Add correct data
            foreach (var l in question.GetCorrectAnswers())
            {
                game.CurrentChallenge.Add(l);
            }

            // Add wrong data
            if (question.GetWrongAnswers() != null)
            {
                foreach (var l in question.GetWrongAnswers())
                {
                    game.NoiseData.Add(l);
                }
            }

            if (game.CurrentChallenge.Count > 0)
            {
                // Show question
                if (!game.ShowChallengePopupWidget(false, OnPopupCloseRequested))
                {
                    if (game.showTutorial)
                    {
                        game.SetCurrentState(game.TutorialState);
                    }
                    else
                    {
                        game.SetCurrentState(game.PlayState);
                    }
                }
            }
            else
            {
                // no more questions
                game.SetCurrentState(game.EndState);
            }
            idleTime = Time.time + idleTimeDuration;
        }
Example #5
0
 void OnQuestionCompleted()
 {
     game.SetCurrentState(game.ResultState);
 }