I'm making a shooter game and have added random obstacles to it to make it more challenging. The problem is trying to make the enemies go around them. They collide with them and sorta slide around them, but I want them to see that the player is behind it and try to get around it without touching it. I tried to do it, but it doesn't really work. Here is my code.
That seems like you have to do stuff with grids to make it work and I just want something fast and simple like what I was trying to do. I don't want something super complicated like that. I just want an enemy to see that there is something in the way, figure out if it would be faster to turn clock wise or counter clock wise, turn that way, then just keep doing that until it is around it.
uhh, make a moderately small 2 dimensional pixel by pixel bool array around the AI, using the list of obstacles to flag spots as collidable, and use A* on that. And while outside of that, just use the walk strait to.
Honestly, that you made the AI just slide around obstacles is pretty good. But A* and algorithms like that is the only way I know how to make the AI walk around obstacles ahead of time.