コード例 #1
0
 public override void Update(GameTime gameTime, Bullets bullets, VoidShip target, Vector2 average, float maxDistanceSquared)
 {
     if (target != null)
     {
         Weapons.targetRelativePosition        = target.Position - position;
         Weapons.targetRelativePositionSquared = Weapons.targetRelativePosition.LengthSquared();
         Weapons.targetRelativeVelocity        = target.Velocity - velocity;
     }
     else
     {
         Weapons.targetRelativePosition        = Vector2.Zero;
         Weapons.targetRelativePositionSquared = 0;
         Weapons.targetRelativeVelocity        = Vector2.Zero;
     }
     Thruster.ControlPC(velocity);
     base.Update(gameTime, bullets);
     Sound.Thrust   = Thruster.Thrust;
     PositionMatrix = Matrix.CreateTranslation(new Vector3(-Position, 0.0f));
     ViewMatrix     = PositionMatrix * ScaleOriginMatrix;
 }