Every tick, after the player's velocity has been updated, the game does these steps to check collisions: