Book Image

HTML5 Game Development by Example: Beginner's Guide

By : Seng Hin Mak
Book Image

HTML5 Game Development by Example: Beginner's Guide

By: Seng Hin Mak

Overview of this book

Table of Contents (18 chapters)
HTML5 Game Development by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
9
Building a Physics Car Game with Box2D and Canvas
Index

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.