public override void Update(ShipControlState controlState, float elapsedTime) { base.Update(controlState, elapsedTime); if (controlState.TryingToShoot(this.controlGroup)) { if (this.game.TimeF > this.dontFireUntil) { this.shoot(); } } }
private void updateMovement(ShipControlState controlState, float elapsedTime) { this.forwards += Angle.FromRadians(controlState.Steer) * elapsedTime; if (controlState.Accelerate) { this.velocity += this.forwards.Vector * this.acceleration * elapsedTime; } var dragFactor = Mathf.Pow(this.inverseFriction, elapsedTime); this.velocity *= dragFactor; this.position += this.velocity * elapsedTime; this.localRotation = Matrix2.CreateRotation(-this.forwards.Radians); }
private void updateEquipment(ShipControlState controlState, float elapsedTime) { foreach (var e in this.equipment) { e.Update(controlState, elapsedTime); } }
public virtual void Update(ShipControlState controlState, float elapsedTime) { this.realPosition = this.owner.LocalToGlobalPosition(this.positionOffset); this.realDirection = this.owner.LocalToGlobalDirection(this.directionOffset); }