Chapter 11. Collisions

By now you will have noticed that the critters in most of our games bounce off of each other. Collision-handling is a somewhat advanced technique used in coding computer games, or any other kind of physical simulation.

If the objects in your game or simulation have complicated shapes, getting them to collide properly can become exceedingly difficult. In games, of course, total physical accuracy isn’t necessary, so we take some shortcuts to enhance our speed. One shortcut that we use in the Pop Framework is that, except for long thin wall critters, we collide our critters with each other as if they were little spheres. Another shortcut – that we didn’t happen to implement here – is to cut the time spent on collisions by ...

Get Software Engineering and Computer Games 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.