Collision Detection

Learn how to remove monsters after the collision takes place.

Removing monsters after collision

Let’s remove the monsters after the player hits them by adding collision detection. We’ll write a combat system in the Health and Melee Combat chapter. For now, walking into a monster will remove it from the dungeon.

Collision detection will be its own system. Adding a new file to the src/systems/collisions.rs, adding mod collisions; to the src/systems/mod.rs file.

Get hands-on with 1400+ tech skills courses.