So Let's say I have a basic cat and mouse kind of game going and have a enemy A.I that is bound to the layout.
I have him set for ever random 1,2 seconds to change his angle of motion, and even have him randomly stop every so often. Now this works ok until he hits the edge of the layout, his sprite starts to slide on layout going up or down, this would be slightly acceptable if it wasn't for he slides up or down at the same angle from when he hit it, as in his sprite doesn't rotate to the new direction.
Now an obvious solution is I could set him not bound to layout and have an "is outside layout" event, but I don't see that as all too far if he can hide as he pleases.
I have tried to look around and haven't seen any solution to this, so I am wondering what is the best way to keep an A.I object bound to the layout and have a proper edge detection.