Example #1
0
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         GameObject      thePlayer = GameObject.Find("Player");
         MovementsPlayer Player    = thePlayer.GetComponent <MovementsPlayer> ();
         Player.OutCollision(Power);
         SoundsManager.PlaySound("playerDying");
         Player.Lifes = Player.Lifes - 1;
     }
 }
Example #2
0
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         GameObject      thePlayer = GameObject.Find("Player");
         MovementsPlayer Player    = thePlayer.GetComponent <MovementsPlayer> ();
         Player.OutCollision(Power);
         GameObject      Donal = GameObject.Find("Donal");
         DonaldMovements donal = Donal.GetComponent <DonaldMovements> ();
         donal.Life = donal.Life - 1;
     }
 }
Example #3
0
 /** Collisions **/
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "EnemyLimit")
     {
         dir = -dir;
         CheckOrientation();
     }
     if (col.gameObject.tag == "Player")
     {
         GameObject      thePlayer = GameObject.Find("Player");
         MovementsPlayer Player    = thePlayer.GetComponent <MovementsPlayer> ();
         Player.Lifes = Player.Lifes - 1;
         Player.OutCollision(5);
     }
 }