I'm having trouble writing a decent collision detection algorithm for a Breakout clone. Determining the ball's position when the collision occurs seems even more difficult. If anyone has written something similar, I would appreciate any help I can get.