© Jarred Capellman, Louis Salin 2020
J. Capellman, L. SalinMonoGame Masteryhttps://doi.org/10.1007/978-1-4842-6309-9_9

9. Collision Detection

Jarred Capellman1  and Louis Salin1
(1)
Cedar Park, TX, USA
 

Think of a video game without collision detection in some shape or form. It’s difficult! Collision detection is ubiquitous and part of many aspects that make up a game. Is the player standing on a platform or should they be falling? How can we prevent the player from stepping beyond the edge of the world map? Did the player get hit by a swirling hammer? Were we successful in picking up the shiny coins? All those things are decided by collision detection. This is what we will explore in this chapter. How can we detect if two objects collided with each ...

Get MonoGame Mastery: Build a Multi-Platform 2D Game and Reusable Game Engine now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.