Example #1
0
        public WebShooter(Body body, CollisionType type)
        {
            Body = body;
            _type = type;

            Add(new KeyBinding(Keys.W, Shorten, true));
            Add(new KeyBinding(Keys.S, Longer, true));
            //IsVisible = true;
        }
Example #2
0
        public PlatformerController(Body body, CollisionType groundType, 
            Keys upKey = Keys.W, Keys leftKey = Keys.A, Keys downKey = Keys.S, Keys rightKey = Keys.D, Keys jumpKey = Keys.Space)
        {
            _body = body;
            _groundControl = new GroundController(body, leftKey, rightKey);
            _airControl = new AirController(body);

            _jumpControl = Add(new JumpController(body, jumpKey));

            Add(new KeyBinding(Keys.LeftShift, SetLightSpeed, SetDefaultState));
            Add(new KeyBinding(Keys.LeftControl, SetControlMode, SetDefaultState));

            _body.CreateContactHandler(groundType, f => SetGroundControl(), f => SetAirControl());
            SetAirControl();
        }
Example #3
0
 public static void SetCollisionType(this Fixture fixture, CollisionType type)
 {
     fixture.CollisionCategories = type.Category;
     fixture.CollidesWith = type.CollideWith;
 }
Example #4
0
 public static void SetCollisionType(this Body body, CollisionType type)
 {
     body.CollisionCategories = type.Category;
     body.CollidesWith = type.CollideWith;
 }
Example #5
0
 public static FixtureContactHandler CreateContactHandler(this Fixture fixture, CollisionType type, ContactHandlerDelegate enter, ContactHandlerDelegate exit)
 {
     return CreateContactHandler(fixture, type.Category, enter, exit);
 }
Example #6
0
 public static BodyContactHandler CreateContactHandler(this Body body, CollisionType type, ContactHandlerDelegate enter, ContactHandlerDelegate exit)
 {
     return CreateContactHandler(body, type.Category, enter, exit);
 }
Example #7
0
 public GrapplingShooter(Body body, CollisionType type)
 {
     Body = body;
     _type = type;
 }