How to Code: Collision Detection

Released 02/19/19

Collision detection is what tells us when two objects have touched. By reacting to collisions, we can increase a user's score within an HTML5 canvas game, change objects' colors only when they have touched, and even determine when a user's character should take damage.

Part I of this series will cover how to implement collision detection between just two objects, while part II will cover how to code collision detection between multiple objects.

Programming collision detection may seem scary at first, but it becomes exponentially easier with a basic understanding of some rudimentary math. Learn how to code this reactive effect in the latest installment of How to Code.

2 Lessons

54:57 minutes

Skill Level



Cheat Sheet Preview

Download The Official Chris Courses HTML5 Canvas Cheat Sheet

Essential canvas syntax at your fingertips.