Logic for moving ball in X-axis