Adding collision detection makes the game playable for the first time. There is no AI, but a 2 player game is now possible.
Using naive collision detection, e.g:
ball.x < paddle.xwould work in a lot of cases but can lead to the ball overlapping the paddle in some cases when the frame interval (dt) is large, or the ball 'just misses'.
This is corrected using more complex, but realistic line intersection calculations.
This allows for realistic behavior when the ball 'just misses' and instead bounces off the top or bottom of the bat and out for a goal
The implementation also detects movement of the paddle and applies 'spin' to change the angle of the ball when appropriate