I know that Sonic 1 had only one layer for tiles -- which is why there are no places in the game where paths cross over themselves (except loop-de-loops, which as far as I know are treated specially by the physics engine to work properly). But, from various quotes here and there, I've come to understand that there are 2 "layers" that tiles can be on in all the genesis games after the original, yet I can find no clear explanation for how they work. I did see in the debug mode for S3&K that at the top of loop-de-loops, there are invisible objects which are ostensibly used to switch Sonic's plane when he crosses over it in either direction, but what if he were to somehow jump over the loop, and then try running in from the opposite side? He would not have crossed that object, yet the game still seems to function correctly here. How does Sonic's collision work in respect to these 2 layers? How does the game know when to switch which layer he collides with?