Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Box2D As3 Collision Detection: Ball Fall Down with Spark

Contacts are created in Box2D Physics simulation when two shape's AABBs overlap. Therefore we can use Contacts to manage collision between shapes.

Please update flash player to view this Flash ActionScript tutorial!

Flash Box2D Physics Simulation Tutorial Content

Contacts are objects created by Box2D to manage collision detection between shapes. We can receive contact data by implementing b2ContactListener. This listener reports a contact point when it is created, when it persists for more than one time step, and when it is destroyed. Keep in mind that two shapes may have multiple contact points.

In this Box2D collision detection tutorial, we use ContactListener to listen to when hitting contacts are created between the falling ball and the slope. For interesting effect we add a sparkle effect when the falling ball touch the slope.

Click your mouse anywhere on the above MovieClip, a ball will be falling down from the mouse pointer. Please play around how it works.

Flash ActionScript Codes:

Almost all flash source codes on this website are free to download. In order to maintain our website, which includes the developement and maintenance of tutorials, we would appreciate your kind contribution by buying some source files at very small fee. Once we get reasonable amount of incentives from contribution or Advertisement sponsors, the source codes will be released for free to download.

Download Flash Source File:

Flash Source File Awaiting to be released.

Remarks:

This Box2D ActionScript tutorial shows how to manage collision detection.