Exemplo n.º 1
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         Reactions mario = FindObjectOfType <Reactions>();
         if (mario.transform.position.y - transform.position.y >= 0.2)
         {
             mario.CounterJump();
             Die(5);
         }
         else
         {
             if (mario.transform.position.x > transform.position.x)
             {
                 mario.DownLvl(1);
             }
             else
             {
                 mario.DownLvl(-1);
             }
             _left = !_left;
         }
     }
 }