An artificial boundary

Think of an artificial boundary inside the wall:

When the center of the ball collides with the artificial boundary:

This is how the code is implemented in the conditional clause of the if statement in Listing 4.