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; }
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(); }
public static void SetCollisionType(this Fixture fixture, CollisionType type) { fixture.CollisionCategories = type.Category; fixture.CollidesWith = type.CollideWith; }
public static void SetCollisionType(this Body body, CollisionType type) { body.CollisionCategories = type.Category; body.CollidesWith = type.CollideWith; }
public static FixtureContactHandler CreateContactHandler(this Fixture fixture, CollisionType type, ContactHandlerDelegate enter, ContactHandlerDelegate exit) { return CreateContactHandler(fixture, type.Category, enter, exit); }
public static BodyContactHandler CreateContactHandler(this Body body, CollisionType type, ContactHandlerDelegate enter, ContactHandlerDelegate exit) { return CreateContactHandler(body, type.Category, enter, exit); }
public GrapplingShooter(Body body, CollisionType type) { Body = body; _type = type; }