03-29-2024, 05:43 PM
I usually don't mind using pixel information. In that Mario Kart clone I wrote (it's seen in some video on my youtube channel) I actually used pixel tests to see on which type of ground the cars were at. I had an invisible image, a small version of the entire map, with just three different colors on it: one for the road, one for grass and one for solid obstacles. So I scaled down a car's position to its equivalent on the "collision image". If the car was on a road pixel everything was fine. If it was on a grass pixel, lower the speed. On a solid obstacle pixel, bounce the car away in the opposite direction.