Handle a possible collision with a wall
The current coordinates of the ball are given by the values of x and y.
They specify the location of the center of the ball.
We don't want to know when the center of the ball collides with the wall.
By that point in time, half the ball will have been buried in the wall.
We want to know when the outside edge of the ball collides with the wall.
Our collision detection scheme must take the radius of the ball into account.