Beispiel #1
0
 private void Update()
 {
     tscore.text = s.ToString();
     if (s == 0)
     {
         cam.backgroundColor = colors[Random.Range(0, colors.Length)];
         ob.resetRotator();
         Level.i++;
         Level.point.Add(GetRandomVal.getPoint());
         s = Level.point[Level.i];
     }
 }
Beispiel #2
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "ROTATOR")
     {
         transform.SetParent(col.transform);
         touched = true;
         col.GetComponent <Rotator>().speed *= GetRandomVal.getRotate();
         Score.s--;
         Total.ts++;
     }
     else if (col.tag == "PIN")
     {
         FindObjectOfType <GameManager>().endGame();
     }
 }
Beispiel #3
0
    public void resetRotator()
    {
        GameObject[] items = GameObject.FindGameObjectsWithTag("PIN");
        foreach (GameObject item in items)
        {
            Destroy(item);
        }
        GameObject rot = GameObject.FindGameObjectWithTag("ROTATOR");

        rot.GetComponent <Rotator>().speed = Mathf.Abs(rot.GetComponent <Rotator>().speed) + GetRandomVal.getSpeed();
    }