Basic AI

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)

Hey Kerek, the only AI I know, is fighting AI. but this guy is awsome at the AI programming!

niiiiiiice :D! very neat stuff!