Warning: A non-numeric value encountered in /home/fixbyp5/public_html/wp-content/themes/Divi/functions.php on line 5752

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.

The next algorithm we are going to look at is called Distance based, or radius based collision detection. In this method, we determine the distance between the centers of two objects and then determine if it is less that the sum of their radii. Be sure to watch to see how, in my haze of being tired, I fail to notice that I am using the Pythagorean Theorem and instead identify the function used as the distance between two vectors.

Full source can be found here.