Flash >> Collision Detection Kit >> Angle of Collision Example

The example may be simple, but the outcome is invaluable.

Detecting when objects collide with one another is great. Detecting collisions based on their shapes rather than their bounding boxes is even better. But what do you do with those objects once they've collided?

The Collision Detection Kit is able to examine the site of a collision and approximate the angle of collision. It also knows how much overlap has occured by number of pixels. This data is returned to the programmer whenever a collision is detected, giving them the tools they need to do something about it.

To learn more about how the Collision Detection Kit can make your physics engine easier to write, please reference the documentation.

This example shows how you can exclude alpha values from collision detections. See how the Collision Detection Kit can exclude colors from collision checking. See how you can detect collisions on the fly. Draw on the stage to see how easy it is to work with organic shapes. The Collision Detection Kit plays well with TextField objects, as this example demonstrates. The kit even works with video. Watch how easy it is in this example. This demonstration shows off an important part of the Collision Detection Kit - returning the angle of collision. The kit accounts for local transforms like scale and rotation, as demonstrated in this example.