public Mobile(MobileInfo info, Vector2 pos, float rot) : base(info, pos, rot) { Type = EntityType.MOBILE; Hull = info.Hull; MaxHull = Hull; Mass = info.Mass; if (Mass != 0) { MassInv = 1 / Mass; } else { MassInv = 0; } CanCollide = info.CanCollide; CollideWithOwnSide = info.CollideWithOwnSide; IsDestroyed = false; DampenInnertia = info.DampenInnertia; RotationWanted = 0; MaxSpeed = info.MaxSpeed; ThrustAcceleration = info.ThrustAcceleration; VelocityWanted = new Vector2(0, 0); BoundingBox = new Rectangle(Model.Bounds.X, Model.Bounds.Y, Model.Bounds.Width, Model.Bounds.Height); AIRoutine = new EntityAI(this); DestructionAnimation = info.DestructionAnimation; }
public Mobile(Texture2D model, EntitySide side, Vector2 pos, float rot, float hull, float mass) : base(model, side, pos, rot) { Type = EntityType.MOBILE; Hull = hull; MaxHull = Hull; Mass = mass; if (Mass != 0) { MassInv = 1 / Mass; } else { MassInv = 0; } CanCollide = true; CollideWithOwnSide = false; IsDestroyed = false; DampenInnertia = true; RotationWanted = 0; MaxSpeed = 401; ThrustAcceleration = 2000; VelocityWanted = new Vector2(0, 0); BoundingBox = new Rectangle(model.Bounds.X, model.Bounds.Y, model.Bounds.Width, model.Bounds.Height); AIRoutine = new EntityAI(this); }
public Mobile(Mobile toCopy) : base(toCopy) { VelocityWanted = new Vector2(toCopy.VelocityWanted.X, toCopy.VelocityWanted.Y); PositionWanted = new Vector2(toCopy.PositionWanted.X, toCopy.PositionWanted.Y); RotationWanted = toCopy.RotationWanted; MaxSpeed = toCopy.MaxSpeed; ThrustAcceleration = toCopy.ThrustAcceleration; Hull = toCopy.Hull; MaxHull = toCopy.MaxHull; Mass = toCopy.Mass; MassInv = toCopy.MassInv; BoundingBox = new Rectangle(toCopy.BoundingBox.X, toCopy.BoundingBox.Y, toCopy.BoundingBox.Width, toCopy.BoundingBox.Height); AIRoutine = toCopy.AIRoutine.GetCopy(); AIRoutine.SetParent(this); CanCollide = toCopy.CanCollide; CollideWithOwnSide = toCopy.CollideWithOwnSide; DampenInnertia = toCopy.DampenInnertia; IsDestroyed = false; Speed = toCopy.Speed; DestructionAnimation = toCopy.DestructionAnimation; }
public EntityAI(EntityAI toCopy) { Parent = toCopy.Parent; LogicFrequency = toCopy.LogicFrequency; TimeLogicLastPerformed = toCopy.LogicFrequency; }