A ball is dropped from a 32-foot wall. Each time it bounces, it rises half as high as the distance it fell. The ball is caught when it is 2 feet off the ground. How many feet does the ball travel before it is caught?