Hey Guys,
I personally have struggled with AI for A LONG time and have figured it out to the point where I could explain it in 2 steps. Here Goes:
The first step in coming up with AI is to get a rough working routine. Even if it is nothing but a simple switch(RND(4)).
The Second Step, Test the game against the AI and Look at how it makes it's moves. Wait until it does something stupid, then go back and change whatever it was to something you would have done. Reapeat this Process and your AI will start to get better and better at the game.
another type of AI is to have the AI check the distance from the player to the "Bot". This technique has been called the "advanced switch system".
Here is an example:
disx=SPRITE X(2)-SPRITE X(1)
disy=SPRITE Y(2)-SPRITE Y(1)
If disx=<300 then gosub _Control_enemy_attack
(sprite 2 is the bot)
I will add more to this section upon request.