Prevent the ball from going off the screen