I would suggest having a state machine. And flag your enemy types with an AI_STATE% field. This can contain IDLE SEARCHING ATTACKING FLEEING whatever you want. Run checks against the ai's current position relative to the player, if its within its sight range, then change the state to searching or chasing and this would change the animation type to walk/run whatever. Next if the ai_state is searching and the player is within weapon range change the state to attacking. If the state is attacking and the player falls out of range, go back to chasing... if the player is out of search range while chasing go back to idle. Its really dumb ai, but it should work for what you are wanting.
Let down by my enemies
Blitz3D Forums/Blitz3D Programming/Let down by my enemiesThe forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.