public Construct(ScrapGame game) { this.game = game; joints = new List<Joint>(); entities = new List<Segment>(); buildElements = new Dictionary<Point,ConstructElement>(); game.constructList.Add(this); }
public Construct(ScrapGame game) { this.game = game; joints = new List <Joint>(); entities = new List <Segment>(); buildElements = new Dictionary <Point, ConstructElement>(); game.constructList.Add(this); }
public ConstructElement(ScrapGame game, Segment entity, Construct construct, Point offSet, Joint rootJoint) { branchJoints = new List<Joint>(); this.rootJoint = rootJoint; this.segment = entity; this.game = game; this.construct = construct; this.offSet = offSet; }
public Nozzle(ScrapGame game, Vector2 position) : base(game) { texture = game.Content.Load<Texture2D>("Crate"); body = BodyFactory.CreateRoundedRectangle(((ScrapGame)game).world, 1f, 1f, .2f, .2f, 5, 1f, this); body.BodyType = BodyType.Dynamic; body.Position = position; }
public Nozzle(ScrapGame game, Vector2 position) : base(game) { texture = game.Content.Load <Texture2D>("Crate"); body = BodyFactory.CreateRoundedRectangle(((ScrapGame)game).world, 1f, 1f, .2f, .2f, 5, 1f, this); body.BodyType = BodyType.Dynamic; body.Position = position; }
public ConstructElement(ScrapGame game, Segment entity, Construct construct, Point offSet, Joint rootJoint) { branchJoints = new List <Joint>(); this.rootJoint = rootJoint; this.segment = entity; this.game = game; this.construct = construct; this.offSet = offSet; }
public Rocket(ScrapGame game, Vector2 position) : base(game) { texture = game.Content.Load<Texture2D>("Rocket"); body = BodyFactory.CreateRoundedRectangle(((ScrapGame)game).world, 1f, 1f, .2f, .2f, 5, 1f, this); body.BodyType = BodyType.Dynamic; body.Position = position; body.Restitution = .1f; body.Friction = .9f; }
public Rocket(ScrapGame game, Vector2 position) : base(game) { texture = game.Content.Load <Texture2D>("Rocket"); body = BodyFactory.CreateRoundedRectangle(((ScrapGame)game).world, 1f, 1f, .2f, .2f, 5, 1f, this); body.BodyType = BodyType.Dynamic; body.Position = position; body.Restitution = .1f; body.Friction = .9f; }
public Wheel(ScrapGame game, Vector2 position) : base(game) { texture = game.Content.Load<Texture2D>("wheel"); wheel = BodyFactory.CreateCircle(game.world, .49f, 1f, this); wheel.Restitution = .5f; wheel.BodyType = BodyType.Dynamic; wheel.Position = position; wheel.Friction = .9f; //wheel.CollisionCategories = new Category(); body = BodyFactory.CreateRectangle(game.world, .5f, .5f, .5f, this); body.Position = position; body.BodyType = BodyType.Dynamic; body.Restitution = .5f; body.Friction = .9f; bodyJoint = JointFactory.CreateRevoluteJoint(game.world, body, wheel, new Vector2(0, 0), new Vector2(0, 0)); }
public DriveWheel(ScrapGame game, Vector2 position) : base(game) { texture = game.Content.Load<Texture2D>("wheel"); wheel = BodyFactory.CreateCircle(game.world, .49f, 2f,this); wheel.Restitution = 1f; wheel.BodyType = BodyType.Dynamic; wheel.Position = position; wheel.Friction = 2f; wheel.UserData = this; body = BodyFactory.CreateRectangle(game.world, .1f, .1f, 2f); body.Position = position; body.BodyType = BodyType.Dynamic; //body.IgnoreCCD = true; wheelHubJoint = JointFactory.CreateRevoluteJoint(game.world, body, wheel, new Vector2(0, 0)); }
public Wheel(ScrapGame game, Vector2 position) : base(game) { texture = game.Content.Load <Texture2D>("wheel"); wheel = BodyFactory.CreateCircle(game.world, .49f, 1f, this); wheel.Restitution = .5f; wheel.BodyType = BodyType.Dynamic; wheel.Position = position; wheel.Friction = .9f; //wheel.CollisionCategories = new Category(); body = BodyFactory.CreateRectangle(game.world, .5f, .5f, .5f, this); body.Position = position; body.BodyType = BodyType.Dynamic; body.Restitution = .5f; body.Friction = .9f; bodyJoint = JointFactory.CreateRevoluteJoint(game.world, body, wheel, new Vector2(0, 0), new Vector2(0, 0)); }
public ScrapBadger(ScrapGame game, Vector2 pos) : base(game) { torsoBack = new Crate(game, pos + new Vector2(-1, 0)); torsoMiddle = new Crate(game, pos); torsoFront = new Crate(game, pos + new Vector2(1, 0)); backWheel = new Wheel(game, pos + new Vector2(-1, 1)); frontWheel = new Wheel(game, pos + new Vector2(1, 1)); rocket1 = new Rocket(game, pos + new Vector2(0, -1)); KeyObject = torsoMiddle; JoinEntities(torsoMiddle, torsoFront, Direction.Right); JoinEntities(torsoMiddle, rocket1, Direction.Up); JoinEntities(torsoMiddle, torsoBack, Direction.Left); JoinEntities(torsoBack, backWheel, Direction.Down); //backWheel.body.UserData = this; //frontWheel.body.UserData = this; JoinEntities(torsoFront, frontWheel, Direction.Down); game.camera.Follow(torsoMiddle, game.camera.Magnification); }
public DriveWheel(ScrapGame game, Vector2 position) : base(game) { texture = game.Content.Load <Texture2D>("wheel"); wheel = BodyFactory.CreateCircle(game.world, .49f, 2f, this); wheel.Restitution = 1f; wheel.BodyType = BodyType.Dynamic; wheel.Position = position; wheel.Friction = 2f; wheel.UserData = this; body = BodyFactory.CreateRectangle(game.world, .1f, .1f, 2f); body.Position = position; body.BodyType = BodyType.Dynamic; //body.IgnoreCCD = true; wheelHubJoint = JointFactory.CreateRevoluteJoint(game.world, body, wheel, new Vector2(0, 0)); }
public ScrapBadger(ScrapGame game, Vector2 pos) : base(game) { torsoBack = new Crate(game, pos + new Vector2(-1,0)); torsoMiddle = new Crate(game, pos); torsoFront = new Crate(game, pos + new Vector2(1, 0)); backWheel = new Wheel(game, pos + new Vector2(-1, 1)); frontWheel = new Wheel(game, pos + new Vector2(1, 1)); rocket1 = new Rocket(game, pos + new Vector2(0, -1)); KeyObject = torsoMiddle; JoinEntities(torsoMiddle, torsoFront, Direction.Right); JoinEntities(torsoMiddle, rocket1, Direction.Up); JoinEntities(torsoMiddle, torsoBack, Direction.Left); JoinEntities(torsoBack, backWheel, Direction.Down); //backWheel.body.UserData = this; //frontWheel.body.UserData = this; JoinEntities(torsoFront, frontWheel, Direction.Down); game.camera.Follow(torsoMiddle, game.camera.Magnification); }
public Nozzle(ScrapGame game) : base(game) { texture = game.Content.Load <Texture2D>("Crate"); }
public Crate(ScrapGame game) : base(game) { texture = game.Content.Load<Texture2D>("Crate"); }
public Segment(ScrapGame game) { this.game = game; game.entityList.Add(this); }
Vector2 WorldLimits = new Vector2(50000, 400);//world limits should be set by the terrain max. public Terrain(ScrapGame game) { this.game = game; }
public Rocket(ScrapGame game) : base(game) { texture = game.Content.Load<Texture2D>("Rocket"); }
public Rocket(ScrapGame game) : base(game) { texture = game.Content.Load <Texture2D>("Rocket"); }