ive been trying to make a little pac-man type game but i cant seem to get the little ghost to move randomely on their own... Anyone have any advice?
Ive tried using the rand function to place it in random rows and colums but it doesnt make it move.
Firstly, http://cplusplus.com/articles/G13hAqkS/
Now, your ghost object needs to remember his position and direction. When he is created, choose a random direction and move him that way. When he hits a wall, choose another random direction.
This ghost will still be very stupid, but that's already an improvement. Now, try figuring out how to choose a direction towards pacman.