About the distance:
If your ball has standard dimensions you can calculate the distance from the size of the circle, you view from the webcam.
The closer the ball is, the bigger the circle will be.
If your ball has not standard dimensions, and a webcam is the only sensor you have, you can make a setup subprogram, that will be called every time the ball changes, so the robot will "learn" the size of the ball. This is a disadvantage but you can measre distance even the robot is still.
A better way (and probably more difficult) , will be to use two webcams. Then you can have a 3D view of the world ! (that's why we have two eyes).
I have not done it, but i think you will need quite complicated algorithms.
There is a third way. The easier one. If your robot head and webcam always have the same distance from the floor, which probably will be true, you can measure the distance after moving a little the robot and keeping the webcam still. Just compare the angle the ball moved to your webcam with the known small distance the robot moved.
The bad thing is that the robot must move to measure the distance.
The angle should be more easily. Just measure the center of the ball, you view from the webcam, with the center of the webcam.