I still have problems writing the AI for my pacman game. Maybe you can look at the source. The blueghost is suppose to follow pacman.