Beispiel #1
0
    public static void SetAddScore(int addScore)
    {
        score        += addScore;
        txtScore.text = score.ToString();

        PlayerPrefs.SetInt("Score", score);
        if (score % 1000 == 0)
        {
            NodeMovement.SetAddSpeed(1f);
            SnakeHeadController.SetAddSpeed(1f);
        }
    }
Beispiel #2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("SnakeHead"))
        {
            _audioEat.Play();
            transform.position = Vector3.down * 2;

            NodeMovement.SetAddSpeed(0.5f);
            SnakeHeadController.SetAddSpeed(0.5f);

            GameManager.SetAddScore(-100);

            Destroy(gameObject, _audioEat.clip.length);
        }
    }