A couple months ago I made a program that does something similar. I called it "walking AI", you can find it here http://scratch.mit.edu/projects/slinger_2/2036575, this project is a lot better in that he actually calculates his next move. It's slightly choppy but all in all it's pretty good (if I don't say so myself). How it works: Although this isn't the best way to do it it works for simple games and such that need a sprite that uses his "mind" to randomly walk around. It scans the walls for distance and puts all of the distance in a list. The walking guy then moves around acording to what the list says. Obviously it's more complicated than that but that's about as simple as I can get it. Download if you *really* want to know how it's done. Please remix this/use in a game/whatever. It was seriously made for you guys. In other words: If you need it, use it.