I am trying to build a Sonic physics engine, and the problem of how to implement collision has left me a bit stumped. I first thought about doing it like the classic games and using height arrays and per-tile angles, but calculating the angles turned out to be complicated. So now I'm thinking about using a simple bitmap (probably will be a PNG with two colors) for collision, and calculating the height by scanning the pixels along the ground sensor lines from the Physics Guide, and then calculating angles with atan2 or something like that. (and still doing the quadrant-switching that the SPG describes) My question is: what problems could this method cause? Is there a better way to do this that I'm missing?