Observe how the Moon orbits the Earth. To program the movement of the Moon, you need to modify its centre of rotation.
This program demonstrates how changing a sprite's centre of rotation can be useful.