Esempio n. 1
0
        private bool Player_body_OnCollision(Fixture sender, Fixture other, tainicom.Aether.Physics2D.Dynamics.Contacts.Contact contact)
        {
            if (other.CollisionGroup == sender.CollisionGroup)
            {
                DoHorizantalBounce(sender, other);
            }

            if (other.CollisionGroup == 0 && body.Position.Y < other.Body.Position.Y)
            {
                isGrounded = true;
                DoJump(0, -jumpSpeed * .5f);
            }


            if (other.CollisionGroup == 6)
            {
                DoHorizantalBounce(sender, other);
            }
            if (other.CollisionGroup == GetOpposedCollisionGroup(true))
            {
                //DoHorizantalBounce(sender, other);
            }


            return(true);
        }
Esempio n. 2
0
 private bool Body_OnCollision(Fixture sender, Fixture other, tainicom.Aether.Physics2D.Dynamics.Contacts.Contact contact)
 {
     if (other.CollisionGroup == thisActor.GetOpposedCollisionGroup(false))
     {
         thisActor.TakeDamage();
     }
     return(true);
 }
Esempio n. 3
0
        private bool Body_OnCollision(Fixture sender, Fixture other, tainicom.Aether.Physics2D.Dynamics.Contacts.Contact contact)
        {
            if (other.CollisionGroup == 0)
            {
                isBeingDestroyed = true;
            }


            return(true);
        }
Esempio n. 4
0
 private void Body_OnSeparation(Fixture sender, Fixture other, tainicom.Aether.Physics2D.Dynamics.Contacts.Contact contact)
 {
     if (other.CollisionGroup == 0)
     {
         isGrounded = false;
         if (currState == AnimStates.Walking)
         {
             currState = AnimStates.Still;
         }
     }
 }
Esempio n. 5
0
 private bool Body_OnCollision(Fixture sender, Fixture other, tainicom.Aether.Physics2D.Dynamics.Contacts.Contact contact)
 {
     if (other.CollisionGroup == thisActor.GetOpposedCollisionGroup(true))
     {
         thisActor.DoJump(100000, 100000);
     }
     if (other.CollisionGroup == thisActor.GetCollisionGroup(true))
     {
         thisActor.DoJump(100000, 100000);
     }
     return(true);
 }
Esempio n. 6
0
 private bool Body_OnCollision(Fixture sender, Fixture other, tainicom.Aether.Physics2D.Dynamics.Contacts.Contact contact)
 {
     if (sender.CollisionGroup != other.CollisionGroup)
     {
         Vector2 pushForce = other.Body.Position - sender.Body.Position;
         pushForce.Normalize();
         pushForce = pushForce * 100000;
     }
     if (other.CollisionGroup == 5)
     {
         SFX.NonHurt.Play();
     }
     return(true);
 }