Esempio n. 1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         karakterCanAzalt.canAzalt(1);
         karakterCanAzalt.can -= 10;
         karakterCanAzalt.ziplat();
     }
     if (other.tag == "mermi")
     {
         Destroy(this.gameObject);
     }
 }
Esempio n. 2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         Destroy(this.gameObject);
         karakterCan.can -= 50;
         for (int i = 0; i < 5; i++)
         {
             karakterCan.canAzalt(1);
             karakterCan.ziplat();
         }
     }
     if (other.tag == "duvar")
     {
         Destroy(this.gameObject);
     }
 }
Esempio n. 3
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "duvar")
     {
         Invoke("fonk", Random.Range(2f, 2.1f));
     }
     if (other.tag == "Player")
     {
         for (int i = 0; i <= 2; i++)
         {
             karakter.canAzalt(1);
         }
         karakter.can -= 30;
         karakter.ziplat();
         Invoke("fonk", Random.Range(2f, 2.1f));
     }
 }
Esempio n. 4
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "duvar")
     {
         patlama.Play();
         ses.GetComponent <AudioSource>().Play();
         bomba.SetActive(false);
         Invoke("fonk", Random.Range(2f, 2.1f));
     }
     if (other.tag == "Player")
     {
         for (int i = 0; i <= 2; i++)
         {
             karakter.canAzalt(1);
         }
         karakter.can -= 30;
         karakter.ziplat();
         patlama.Play();
         ses.GetComponent <AudioSource>().Play();
         bomba.SetActive(false);
         Invoke("fonk", Random.Range(2f, 2.1f));
     }
 }