void Update()
 {
     distanceUntilNextScoreIncrease -= trackObjectManager.MoveDelta;
     if (distanceUntilNextScoreIncrease < 0 && !gameOver.GameIsOver)
     {
         scoreCounter.AddToScore(scorePerSection);
         distanceUntilNextScoreIncrease += sectionLength;
     }
 }
示例#2
0
    private void OnCollisionStay2D(Collision2D collision)
    {
        if (collision.gameObject.CompareTag("Platform") && grounded)
        {
            if (!addedPointsForGrounded)
            {
                scoreCounter.AddToScore(scoreBonus);
                addedPointsForGrounded = true;
            }

            collision.gameObject.GetComponent <Platform>().crumbling = true;
            transform.SetParent(collision.transform);
        }
    }
示例#3
0
 // Update is called once per frame
 void Update()
 {
     if (createMode == true)
     {
         if (Input.GetMouseButtonDown(0))
         {
             Instantiate(newNote, Input.mousePosition, Quaternion.identity);
         }
     }
     else if (createMode == false)
     {
         if (Input.GetMouseButtonDown(0) && active)
         {
             scoreCounter.AddToScore(6);
             Destroy(tap);
         }
     }
 }
示例#4
0
    // Update is called once per frame
    void Update()
    {
        if (popupManager.ActionKeyBlocked())
        {
            return;
        }

        if (carryingCarrot)
        {
            if (inCarrotPile && Input.GetButtonDown("Action"))
            {
                carryingCarrot = false;
                mouthCarrot.SetActive(false);
                scoreCounter.AddToScore(1);
                carrotPile.AddCarrot();
                mirror.MirrorActions();

                if (!tutorial3WasShown)
                {
                    PopupManager.instance.ShowPopupTutorial3(); tutorial3WasShown = true;
                }
            }
        }
        else
        {
            Carrot nearestCarrot = fieldManager.GetNearestFullGrownCarrot(transform.position);
            if (nearestCarrot != null &&
                Vector3.Distance(transform.position, nearestCarrot.transform.position) < pickDistance)
            {
                if (Input.GetButtonDown("Action"))
                {
                    Destroy(nearestCarrot.gameObject);
                    carryingCarrot = true;
                    mouthCarrot.SetActive(true);

                    if (!tutorial2WasShown)
                    {
                        PopupManager.instance.ShowPopupTutorial2(); tutorial2WasShown = true;
                    }
                }
            }
        }
    }
示例#5
0
 private void CollectCoin(Coin coin)
 {
     coin.Collect();
     scoreCounter.AddToScore(coin.Value);
     audioEffects.PlayEffect("Coin");
 }
示例#6
0
 public void TapButton()
 {
     scoreCounter.AddToScore(6);
     Destroy(this.gameObject);
 }