Free ActionScript

Flash AS2 & AS3 Tutorials, Game Code, Effects, Source Files & Sample Downloads

Pixel Perfect Collision Detection

Preview v1.0.1

Download Fla Sample

Download Fla Sample

This script was based on an example by Mike Chambers: Using BitmapData.hitTest for Collision Detection.

Update – v1.0.1
Added dynamic clip highlighting on hit

Physics – Multiple objects (balls) colliding

After months and months of trying to figure this one out, I finally managed to build a fully working example!

So, here is the first version of my Simple Physics script – multiple balls colliding and bouncing off each other.

Preview

Download Fla Sample

Download Fla Sample

I have to give credit to a book called HTML5 Canvas by Steve Fulton & Jeff Fulton (great book!). It was very hard to grasp the law of conservation of momentum without it. Thanks guys!