To keep the ghosts on the green line, give them the same purple dot ( or a different color if you want) sprite for each ghost, and make it so if it touches the black, it won't go any further. As to how to make them go in different directions, like the real pac man, I don't know.
Offline