Wednesday, August 10, 2011

Pixel perfect collision RESPONSE?

Okay, so I have developed a 2d game using C++ and SFML for the graphics. I have come up with an algorithm for detecting pixel-perfect collisions. It works like this- It first checks collision circles, and then bounding boxes. It then checks in the region where the bounding boxes overlap, whether or not there are two pixels that overlap each other, and simply returns whether or not they did (No collision normals or how much they overlap or the internet distance or anything of the sorts). It works like a charm. But now that I have successfully DETECTED collision, I need to know how to RESPOND. I want to be able to push back my character out of the occluding obstacle, just knowing his speed (May or may not be zero), and whether or not he has collided. Google doesn't give me relevant results... Thanks in advance to whomever can help.

No comments:

Post a Comment