previousnext

Collisions are fundamental for many games. One might think that they are easy to implement but, as soon as we are dealing with non-rectangular objects, things get complicated very quickly.

For collisions between the ball and the paddle, we will simplify things and assume that there is a collision if the lowest point of the ball touches (or passes through) the bottom of the paddle; otherwise, we will assume that it missed.

Run the (hidden) code to see what I mean.

previousnext