Alright so ive been making a pacman game and have came to doing the ghost. So far I have it were if they collide with a wall they will random generate a number to choose which way to go. The only problem is I need to make it turn with out colliding also. Does anyone have anyidea how to do this.