예제 #1
0
    public void CheckInput(string s)
    {
        if (input.text != string.Empty)
        {
            string uppercase = input.text.ToUpper();

            if (word.MatchingWords.Contains(uppercase) && !answers.Contains(input.text))
            {
                Debug.Log(uppercase + " is valid");
                answers.Add(input.text);

                //TODO: Activate event
                Correct.Invoke();
                audioManager.PlaySoundEffect("Good");

                DoAction();
            }
            else
            {
                Debug.Log(uppercase + " is not valid");

                //TODO: Activate event
                Incorrect.Invoke();
                audioManager.PlaySoundEffect("Bad");
            }

            ActivateInputField();
            input.text = string.Empty;
        }
    }
예제 #2
0
    private void EndInput()
    {
        lockedKey = true;
        if (N != userNumber)
        {
            Incorrect++;
            IC.text    = Incorrect.ToString();
            text.text  = "WRONG";
            text.color = Color.red;

            if (consecutiveI != 0)
            {
                speed += 0.05f;
                if (speed > 1f)
                {
                    speed = 1f;
                }
            }
            consecutiveI++;
            consecutiveC = 0;
        }
        else
        {
            Correct++;
            CC.text    = Correct.ToString();
            text.text  = "CORRECT";
            text.color = Color.green;

            if (consecutiveC != 0)
            {
                speed -= 0.05f;
                if (speed < 0.05f)
                {
                    speed = 0.05f;
                }
            }
            consecutiveC++;
            consecutiveI = 0;
        }

        if ((round - 1) % 20 == 0)
        {
            speed = 0.5f;
        }

        if (round < 100)
        {
            sec2timer = Time.time + sec2t;
            s2t       = true;
        }
        else
        {
            text.text = "Correct: " + Correct + "\nIncorrect: " + Incorrect;
            a         = true;
        }
    }
예제 #3
0
 //Valider la question et changer la question
 public void validerQuestion(bool boolean)
 {
     if (boolean)
     {
         questionBonnes++;
         Correct.SetActive(true);
         changerQuestion();
     }
     else
     {
         Incorrect.SetActive(true);
         changerQuestion();
     }
 }
예제 #4
0
        public async Task It_will_fail_with_a_DebugAssert_if_Algorithm_name_property_is_not_also_overriden()
        {
            var incorrect = new Incorrect();

            try
            {
                await incorrect.Get("TSTDRV1234", new Uri("https://someserver.com"), "TKN", "SEC");

                Assert.False(true, "An assertion failure should have happened.");
            }
            catch (Exception e)
            {
                e.GetType().Name.Should().Contain("Assert");
            }
        }
예제 #5
0
파일: Form1.cs 프로젝트: LukeLasley/Sudoku
 //checks to see if user solved puzzle
 public void checkSolution()
 {
     //if they are correct give them the option of a new puzzle
     if (gameController.checkSolution())
     {
         CorrectSolution correct = new CorrectSolution(gameController);
         correct.Show();
     }
     else
     //tell them they are incorrect give them an option for a hint, to continue or a new puzzle
     {
         Incorrect incorrect = new Incorrect(gameController, this);
         incorrect.Show();
     }
 }
예제 #6
0
파일: Game.cs 프로젝트: mlstroud/hangman
 public static void Guess(char guess)
 {
     if (Word.Contains(guess))
     {
         for (int i = 0; i < Word.Length; i++)
         {
             if (Word[i] == guess)
             {
                 HiddenWord[i] = guess;
             }
         }
     }
     else
     {
         Incorrect.Add(guess);
     }
 }
예제 #7
0
    // Update is called once per frame
    void Update()
    {
        personnageCtrl.deplacer(Input.GetAxis("Horizontal"));

        if (Input.GetAxis("Vertical") > 0)
        {
            personnageCtrl.sauter();
        }

        if (personnageCtrl.getErreursRestantes() < 1)
        {
            gameOver();
        }
        //Verifier qu'on a obtenu le trophé et commencer le test
        if (personnageCtrl.finNiveau && TestActif == false)
        {
            TestActif = true;
            Question1.SetActive(true);
            Time.timeScale = 0f;
        }
        //Mettre a jour le HP restant
        chancesRestantes.text = personnageCtrl.getErreursRestantes().ToString();

        //Rétroaction lorsqu' on répond à une question
        if (Correct.activeSelf || Incorrect.activeSelf)
        {
            if (Input.anyKeyDown)
            {
                Correct.SetActive(false);
                Incorrect.SetActive(false);
            }
        }
        if (FinQuiz.activeSelf)
        {
            if (Input.anyKeyDown)
            {
                changerQuestion();
            }
        }
    }
 public bool Equals(Incorrect other) => false;