just hit the flag
this is another pathfinding ai that I made, it is slightly smarter than the last one but way more resource intensive