Example #1
0
 public void loseHearts()
 {
     if (numHearts == 0)
     {
         PowerUps.sqIsActive = false;
         QuizOpen.GetInstance().Resume();
         SceneManager.LoadScene("GameOver");
     }
     numHearts--;
 }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape) && (QuizOpen.GetInstance().isOpen() == false))
     {
         if (GameIsPaused)
         {
             Resume();
         }
         else
         {
             PauseGame();
         }
     }
 }
Example #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;
        }
    }
Example #4
0
 public void GameEnd()
 {
     QuizOpen.GetInstance().Resume();
     SceneManager.LoadScene("GameOver");
 }
Example #5
0
 private void Update()
 {
     active = QuizOpen.GetInstance().isOpen() ? true : false;
     StartCoroutine(SetTimer());
 }
Example #6
0
 public void Select()
 {
     QuizOpen.GetInstance().Answer(this);
 }
Example #7
0
 public void UseSQ()
 {
     QuizOpen.GetInstance().Resume();
     pUp1.gameObject.SetActive(false);
     sqIsActive = false;
 }