Click the green to play the example. This example has 4 different objects that move until their x or y value reaches a certain spot. Once they reach that spot the sprite resets. Drag the sliders to different values to see how far they are able to move changes.