Beispiel #1
0
        private bool OnCollidedWith(Fixture f1, WorldGeometry2 collidedWith, Fixture f2, Contact contact)
        {
            this.PatrolDirection *= -1;

            return true;
        }
Beispiel #2
0
 void OnSeparation(Fixture f, WorldGeometry2 wg, Fixture wF)
 {
     collided.RemoveWhere(x => x.Item1 == wF);
 }
Beispiel #3
0
        bool HitWorld(Fixture wheel, WorldGeometry2 w, Fixture wFix, Contact c)
        {
            if (!wheel.IsSensor && midLunge && waitForWorldContact)
            {
                midLunge = false;
                waitForWorldContact = false;

                var force = character.Position - Physics.Position;

                if (force.X > 0 && WheelSpeed < 0 || force.X < 0 && WheelSpeed > 0)
                    WheelSpeed *= -1;
            }
            return c.Enabled;
        }
Beispiel #4
0
        bool OnCollidedWith(Fixture f, WorldGeometry2 wg, Fixture wF, Contact info)
        {
            Vector2 norm;
            FarseerPhysics.Common.FixedArray2<Vector2> pts;
            info.GetWorldManifold(out norm, out pts);
            norm.Normalize();

            if (!collided.Any(x => x.Item1 == wF))
                collided.Add(Tuple.Create(wF, norm));

            Physics.IgnoreGravity = true;
            return info.Enabled;
        }
Beispiel #5
0
 void LeftWorld(Fixture wheel, WorldGeometry2 w, Fixture wFix)
 {
     if (midLunge && !waitForWorldContact)
     {
         waitForWorldContact = true;
     }
 }