Actionscript 3 hitTestObject and Pixel Perfect Collision Detection
For a flash game project, i needed to see if a number of sprites had collided. I soon found out that hitTestObject doesn't support perfect collisions for non-shape sprites, so i needed another solution.
After wasting some time discovering hitTestObject only supports bounding rectangles for non shape sprites, i needed to find a pixel perfect collision detection method that worked on any sprites. One of the ways i've done it in the past is quite common, and has been used a lot over the years. You can approximate most sprites fairly well using a series of circles to form a collision detection area. Then it's fairly easy and reasonably fast to see if any circles have collided. This time however, i wanted to use pixel perfect accuracy, but i wasn't sure if flash was powerful enough to cope with such a task. It turns out that Flash Player 9 and actionscript 3 handle the job reasonably well with a clever bit of code from some smart cookies.
Recent comments
3 min 13 sec ago
9 min 29 sec ago
11 hours 1 min ago
1 week 1 day ago
1 week 2 days ago
1 week 5 days ago
6 weeks 1 day ago
7 weeks 6 days ago
8 weeks 22 hours ago
9 weeks 1 day ago