Beginning collision detection

We have checked the boundary of the playground when moving the ball in the previous section. Now, we can control the paddles with the keyboard and watch the ball move around the playground. What is missing now? We cannot interact with the ball. We control the paddles but the ball just passes through them as if they are not there. This is because we missed the collision detection between the paddles and the moving ball.

Get HTML5 Game Development by Example : Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.