I've recently been using the Sonic Physics Guide to determine how tile-based collisions should be handled in my project. So far, I have a tile sensor and when a tile is found, its alpha channel is scanned. This is to form a height mask of the tile, and then I set Sonic's Y-pos to the Y-pos of the tile + its height offset at the X-pos of the sensor.
What I want to know now (and it is unfortunate that the SPG doesn't mention this) is how is the (surface) angle of a given tile supposed to be calculated and are there better alternatives? Of course, I do know that this will involve using the A-tan2 function, but alas, I do want to make sure that I do this properly.
What I want to know now (and it is unfortunate that the SPG doesn't mention this) is how is the (surface) angle of a given tile supposed to be calculated and are there better alternatives? Of course, I do know that this will involve using the A-tan2 function, but alas, I do want to make sure that I do this properly.