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 not calculating the collisions between objects that aren't presently in the field of view.

Let's start with how the individual critters collide, and then work our way up to how a game orchestrates all of the relevant collisions.

    Part I: Software Engineering and Computer Games
    Part II: Software Engineering and Computer Games Reference