Four weeks ago we started work on our collision system and in that time we’ve done a lot: we created collider components, the data structure to store the components, and the collision system to check for and resolve any collisions. All that’s left is to add the collider components to the tiles and player object and call the new collision system that we wrote last week. Which means that by the end of this tutorial we should finally have collisions working!
We first check if the layer is named “Collisions”, so make sure the layer containing the collision tiles has this name in Tiled. For more information on layers and Tiled see my earlier tutorial. Doing it this way allows us more control over what tiles we collide with, and reduces the collision calls drastically than if we were to collide with every tile.