• Please stop embedding files/images from Discord. Discord has anti-hotlinking logic in place that breaks links to Discord hosted files and images when linked to from anywhere outside of Discord. There are a multitude of file/image hosting sites you can use instead.

    (more info here)

How exactly does collision work?

Sep 14, 2026 at 10:31 PM
Novice Member
"Officially Worth 1 Rupee"
Join Date: Sep 13, 2026
Location:
Posts: 1
I've been checking out the CSE2 code, and for some reason I don't understand the collision code. In the HitMyCharMap function, we have two different arrays labeled as offsets for X and Y. They have four values, and enumerating through them starts with us checking our current tile, the tile to our right, the tile below us, then the tile below us and to the right. We have a for loop that gets the tile flag from these tiles as we iterate.

At least, that's what I think it's doing. In that case, when are we checking the tiles to our left and above? Is there no priority in which direction we check for collision first? Can anyone please help explain the collision?
 
Back
Top