Conclusion#

In this tutorial series, we've discussed collision detection between two rectangles and between two circles. We then implemented the ideas into code into a MonoGame game project. These two methods are foundational for 2D collision detection in any game development environment and many other implementations can be built off of them. One thing we did not discuss in this series however was collision detection between more complex polygons such as triangles, pentagons, hexagons, etc. We also did not discuss checking collisions between a polygon and a circle.

To perform these collision detections, you would most likely use what is called Separating Axis Theorem. The maths behind this have been discussed in length in many other tutorials far better than I could explain, so I will defer you to read those. If you are interested in further reading about this, please see the following articles as a good starting point

Last updated on by Christopher Whitley