[quote:ikm9x27w]random(2) will give you 0,1 or 2 from what I've seen so far. Maybe that requires a little messing around with .caps.
Ok then would this be better? random(1)+1
[quote:ikm9x27w]First of all, you need to keep track of the angle of the ghost, so you know which direction it's moving in. Second of all, you need to check in the direction you're about to move with an overlap at offset check, before you move in that direction. Right now you change directions at random without making sure there's a wall in that direction first.
I'm now tracking the direction but the offset doesn't appear to work.... or more correctly, I don't seem to understand it.
I've updated http://www.rosmini.school.nz/downloads/pacman.cap