What’s the best way to program basic AI into an enemy??
Say we want an enemy to walk back and forth protecting an entrance until the hero is within eyes view. Then that enemy would charge at the hero and try to attack randomly.
What would be the best way to do this? (Any other AI tips too please)