2D Game Dev – Part 12.0 – Collision Detection

This post is a portion of Part 12 in my on going series about 2D Game Development using the Allegro 5 library. These posts are in course order. You can see all of the posts in this course by clicking the “2D Game Development” button at the top of this site.

Worlds Collide

In game development, and more specifically programming, there are many pieces that have to fit correctly in an efficient manner. Of these things, efficient collision detection is the Holy Grail. Many games that come out, whether they are 2D or 3D, fighting or shooting, often cause player frustration with improperly handled collision detection. In some games, an obvious hit get’s ignored by the system, while other times complete misses end up killing you. While I am not going to get into the intricacies of 3D collision detection, the concepts are primarily the same. We need to detect when two or more objects are occupying the same “world space”.

Preface

Before we get into the different types of collision detection, it is worth noting what will and won’t be covered. First off, this section is on the detection of collision and not the resolution of collision. These videos will only take you so far. What happens when a collision occurs is a very specific question whose answer needs to be tailored to your specific game. Also, in keeping with the theme of this web series, I won’t be getting too far into the complexities of some of the potential algorithms. Even when I cover pixel perfect collision detection, I am still going to keep the conversation more high level. Finally, I am presenting the concepts here. There may be more efficient means of achieving the same thing. This isn’t necessarily a code clinic as much as an intro.

Let’s get to it!




1 Comment

  1. Great tutorials Mike Greetings From Peru, keep it up!

    Extra: It would be nice if You could manage a way to translate your vids or at least your text in a proper way so that a little developing team from here that’s very interested into learning ALLEGRO 5 could understand You even better.

    anyways thanks for all the help so far!

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>