public override void CollidedWith(GameObject obj)
 {
     if (obj.BoundingBox.Intersects(m_sphere))
     {
         m_collision = CollisionType.Building;
     }
     else
     {
         m_collision = CollisionType.None;
     }
 }
        public void Update(GameObject target)
        {
            // set the proper rotation
            m_yaw = MathHelper.ToRadians(Utils.ComputeYaw(m_position, target.Position));

            //Move towards player until im close enough to attack
            if (Vector3.Distance(target.Position, m_position) > 2f)
            {
                Matrix forwardMovement = Matrix.CreateRotationY(m_yaw);
                Vector3 v2 = new Vector3(0, 0, m_forwardspeed / 10);
                v2 = Vector3.Transform(v2, forwardMovement);
                m_position.Z -= v2.Z;
                m_position.X -= v2.X;
            }
        }
        public void Update(GameObject target, GameTime gameTime)
        {
            // set the proper rotation
            m_yaw = MathHelper.ToRadians(Utils.ComputeYaw(m_position, target.Position));

            //Move towards player until im close enough to attack
            if (Vector3.Distance(target.Position, m_position) > 2f)
            {
                Matrix forwardMovement = Matrix.CreateRotationY(m_yaw);
                Vector3 v2 = new Vector3(0, 0, m_forwardspeed / 10);
                v2 = Vector3.Transform(v2, forwardMovement);
                m_position.Z -= v2.Z;
                m_position.X -= v2.X;
            }
            if (m_anim != null)
            {
                m_anim.Update(gameTime.ElapsedGameTime, true, Matrix.Identity * Matrix.CreateScale(2.7f) *
                                    Matrix.CreateFromQuaternion(Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), -1.57f)) *
                                    Matrix.CreateFromQuaternion(Quaternion.CreateFromAxisAngle(new Vector3(0, 1, 0), 3.14f)) *
                                    Matrix.CreateRotationY(m_yaw) *
                                    Matrix.CreateTranslation(m_position));
            }
        }
 /// <summary>
 /// Adds entity to entity list
 /// </summary>
 /// <param name="entity">Entity to be added</param>
 public void AddEntity(GameObject entity)
 {
     m_bounds.Add(entity);
     m_count++;
 }
 public virtual void CollidedWith(GameObject obj)
 {
 }
        public void UpdateEnemies(GameObject target, GameTime gameTime)
        {
            foreach (GameObject en in m_objects)
            {
                if (en is Enemy)
                {
                    Enemy m = (Enemy)en;
                    m.Update(target,gameTime);
                }

            }
        }
 //Remove entity
 public void RemoveObject(GameObject entity)
 {
     entity.Dispose();
     m_objects.Remove(entity);
 }