Beispiel #1
0
    /// <summary>
    /// This checks if the cards are initialised or not
    /// when the mouse is clicked then calls the function checkCards.
    /// </summary>
    void Update()
    {
        if (_matches == 0)
        {
            if (playAudio)
            {
                sound.PlayOneShot(winning);
                playAudio = false;
            }
            lvlFM.OnLevelFinished();
        }

        if (!_init)
        {
            initializeCards();
        }
        if (Input.GetMouseButtonUp(0))
        {
            checkCards();
        }
        if (_matches != cards.Length / 2)
        {
            stopAllAnimations();
        }
        if (finishedTutorial)
        {
            enableAllCards();
        }
    }
Beispiel #2
0
 /// <summary>
 /// Increments the counter.
 /// </summary>
 private void incrementTheCounter()
 {
     counter++;
     incrementCounter = false;
     if (counter == 11)
     {
         lvlFM.OnLevelFinished();            // display success window
     }
 }
Beispiel #3
0
 /// <summary>
 /// Moves to next scene.
 /// </summary>
 public void moveToNextScene()
 {
     if (SceneManager.GetActiveScene().name == "CremeApplication")
     {
         SceneManager.LoadScene("InjectionBaby", LoadSceneMode.Single);
     }
     else if (SceneManager.GetActiveScene().name == "InjectionBaby")
     {
         scoreSlider.SetActive(false);
         lvlFM.OnLevelFinished();
     }
 }
Beispiel #4
0
    void Update()
    {
        changeSprite();
        if (gameWon)
        {
            lvlFM.OnLevelFinished();
        }

        if (bubbleScript.isFirstPinkBubbleSecondClicked)
        {
            bottleEnabled = true;
        }
    }
Beispiel #5
0
 void doUpdate()
 {
     if (timeStillRemaining())
     {
         if (decreaseBar)
         {
             if (inRedZone())
             {
                 changeLoadingBarColorToRed();
             }
         }
         updateLoadingBar();
     }
     else
     {
         counter += Time.deltaTime;
         if (counter > 0.1)
         {
             lvlFM.OnLevelFinished();
             counter = 0f;
         }
     }
 }
Beispiel #6
0
 /// <summary>
 /// Method called when the level is cleared, used to move to the next stage.
 /// </summary>
 public void levelCleared()
 {
     levelOver = true; //Signals to the script that the game has ended
     cheerAudio.GetComponent <AudioSource>().Play();
     lvlFM.OnLevelFinished();
 }