예제 #1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (this.Location.Owner != this.Owner ||
                ((this.State == States.MOVING) &&
                 (this.Destination.Owner != this.Owner)))
            {
                this.Game.DynamicEntityList.Remove(this);
            }

            if (this.State == States.ATTACKING)
            {
                this.Velocity = Vector2.Zero;
                this.Attack(TargetEntity, gameTime);
            }

            if (HitPoint <= 0)
            {
                this.Game.DynamicEntityList.Remove(this);
                if (TargetEntity != null)
                {
                    TargetEntity.SetVelocityAndRotation();
                    TargetEntity.State        = States.MOVING;
                    TargetEntity.TargetEntity = null;
                }
            }
        }