示例#1
0
        private PhysicsObject CreateBorder(double width, double height)
        {
            PhysicsObject b = PhysicsObject.CreateStaticObject(width, height);

            b.Color = Color.Gray;
            b.Body.CollisionIgnorer = ignorerForBorders;
            game.Add(b);
            return(b);
        }
示例#2
0
        private PhysicsObject CreateSegment(double width, double height, Shape shape)
        {
            PhysicsObject o = PhysicsObject.CreateStaticObject(width, height, shape);

            o.Color = Color.Gray;
            o.IgnoresCollisionResponse = true;
            o.KineticFriction          = DefaultFriction;

            // TopDownPhysicsGame does not exist in MonoJypeli
            //if (Game.Instance is TopDownPhysicsGame)
            //{
            //    TopDownPhysicsGame g = (TopDownPhysicsGame)Game.Instance;
            //    g.AddSurface(o);
            //}
            //else
            //{
            Game.Instance.Add(o);
            //}

            return(o);
        }