9781430247166_CO-01.jpg

Chapter 8

Bumping into Things

What makes most computer games fun to play is that they are, in their essence, stylized simulations of the real world. Like the real world, they contain objects that you can interact with in some way. These objects might be walls that block your movement, friends who help you, or enemies who harm you.

To create these sorts of interactive objects, you first need a way of finding out whether one object is touching another object. In computer programming, this is called collision detection. Collision detection is a term for what happens when things bump into one another

In this chapter you’re going to learn how to figure ...

Get Foundation Game Design with HTML5 and JavaScript 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.