Пример #1
0
 public void loseHearts()
 {
     if (numHearts == 0)
     {
         PowerUps.sqIsActive = false;
         QuizOpen.GetInstance().Resume();
         SceneManager.LoadScene("GameOver");
     }
     numHearts--;
 }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape) && (QuizOpen.GetInstance().isOpen() == false))
     {
         if (GameIsPaused)
         {
             Resume();
         }
         else
         {
             PauseGame();
         }
     }
 }
Пример #3
0
    public IEnumerator SetTimer()
    {
        tText();
        while ((running == false) && (active == true) && (timeLeft > 0))
        {
            running = true;
            yield return(new WaitForSeconds(1));

            timeLeft--;
            if (timeLeft == 0)
            {
                QuizOpen.GetInstance().Resume();
                SceneManager.LoadScene("GameOver");
            }
            running = false;
        }
    }
Пример #4
0
    // Update is called once per frame

    void Update()
    {
        // Replace  with stepping on tiles later on
        if (Input.GetKeyDown(KeyCode.Q) && !quizOpen)
        {
            if (api) // Checks if the api is present.
            {
                api.MakeRequest(
                    new Action <Response>((Response response) =>
                {
                    question = response.results;
                    Quiz();
                })
                    );
            }
            instance = this;
        }
    }
Пример #5
0
    // Update is called once per frame

    void Update()
    {
        // Replace  with stepping on tiles later on
        instance = this;
        if (GridManager.requestQuestion && !quizOpen)
        {
            busy = true;
            GridManager.requestQuestion = false;

            if (api) // Checks if the api is present.
            {
                api.MakeRequest(
                    new Action <Response>((Response response) =>
                {
                    question = response.results;
                    Quiz();
                })
                    );
            }
            else
            {
            }
        }
    }
Пример #6
0
 public void GameEnd()
 {
     QuizOpen.GetInstance().Resume();
     SceneManager.LoadScene("GameOver");
 }
Пример #7
0
 private void Update()
 {
     active = QuizOpen.GetInstance().isOpen() ? true : false;
     StartCoroutine(SetTimer());
 }
Пример #8
0
 public void Select()
 {
     QuizOpen.GetInstance().Answer(this);
 }
Пример #9
0
 public void UseSQ()
 {
     QuizOpen.GetInstance().Resume();
     pUp1.gameObject.SetActive(false);
     sqIsActive = false;
 }