In this tutorial you see how to define paths for the sprites to follow during their movement. This is one way to do it however there are many other ways.