This inexplicable slows down the animation something fierce. I'll have to fix it, or remove it. Added a black sprite in the lower right corner to restart the movie, and took that functionality out of the red ball. Mine wouldn't, and as a result, I had to switch to the black sprite on the bottom layer. Michael Shaff threw down the gauntlet of optimization, and I picked it up a bit.
Sprites now do no less than five tests to see if they are colliding.
This is where the math starts to get ugly, but we rarely get here. This tests whether the sprites overlap. Are the sprites getting closer or farther apart. Each time a sprite has a collision, it calculates, at its new velocity, which wall it will hit, and in how many frames. It then sets a counter to one less than that, and then just decrements it.