Hey,
What I currently have is that a AI can approach a given target (say a box), after it gets there I want it to randomly walk to one of its sides. What would be a good approach to implement this?
Hey,
What I currently have is that a AI can approach a given target (say a box), after it gets there I want it to randomly walk to one of its sides. What would be a good approach to implement this?
Make an array which contain different box, test if there is a collision with one box, if true then yield and choose a random element from (random array.length)
Determine the N (assuming 3, the sides other than the side the AI is currently at) other positions you would like to move to. Check to see if those are valid positions to actually move to. Randomly choose one (if any) of the valid positions. Move to the randomly selected position. Upon arrival, repeat the process. You can cache some of the results per box.