Danmaku_no_Kyojin.BulletEngine.Bullet.Update C# (CSharp) Method

Update() public method

Update this bullet. Called once every 1/60th of a second during runtime
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void
        public override void Update(GameTime gameTime)
        {
            //Flag to tell whether or not this bullet has finished all its tasks
            for (int i = 0; i < _tasks.Count; i++)
            {
                _activeTaskNum = i;
                _tasks[i].Run(this);
            }

            //only do this stuff if the bullet isn't done, cuz sin/cosin are expensive
            X += Acceleration.X + (float)(Math.Sin(Direction) * Velocity * ((float)gameTime.ElapsedGameTime.TotalSeconds * 150));
            Y += Acceleration.Y + (float)(-Math.Cos(Direction) * Velocity * ((float)gameTime.ElapsedGameTime.TotalSeconds * 150));
        }