change position of the ball when dragging