Table of Contents

Collision Detection Introduction

In this tutorial series, we're going to discuss two different methods of collision detection used in 2D games. These methods are:

  • Axis-Aligned Bounding Box (AABB)
  • Circle Collision

As we discuss each of these methods, we're going to create an implementation of them in a new MonoGame 3.8.1.303 game project.

Prerequisites

To follow along with this tutorial, you will need to create a brand new MonoGame game project. For the purposes of this tutorial and the supplied project files, I'll be creating a MonoGame Cross Platform Desktop (DesktopGL) project.

Project Files

You can find the completed version of the projected created with this demo at https://github.com/AristurtleDev/aristurlte-tutorial-files/tree/main/collision-detection-tutorial

Code License

All code written in this COllision Detection tutorial series, unless otherwise stated, is licensed under The Unlicense. This license extends to only the code written, not the tutorial documentation itself. The license text is as follows

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>

With that out of the way, let's jump to the next page of the tutorial to get started.

Last updated on 10/18/2023 by Christopher Whitley