Need help with simple AI system
I need a somewhat simple AI for my enemies, they will spawn at random location at left, go to the right, but change directon if certain things "catch their attention" or get close enough, if that happens they will walk toward that object instead. If that object dissapears or goes out of range they should resume their walk to the right part of the screen. Any ideas on how to do this?
Re: Need help with simple AI system
You have to set up Actions and Events for all these posibilities. Since each object has its own Alterable Values, you can use these to perform calculations based on each individual enemy.
Respawning on the left should be easy enough to do.
They move right but change direction is certain things catch their attention... Well, you would need to code for these certain things. Once one of them affects an enemy, change its direction.
What you could do is use Alterable Value A for direction control. If 0, the enemy moves right. If something catches the enemies attention, set Alterable Value A to 1, 2, 3, whatever. When set to this value, it moves to the object in question. If the object is destroyed, return the Alterable Value A to 0 and the enemy will move right again.