HomeAbout

CollisionDetection

From the site:

The com.gskinner.sprites.CollisionDetection class is really simple to work with, there is a single static method called checkForCollision with four parameters:

checkForCollision(movieClip1,movieClip2,alphaTolerance);

movieClip1, movieClip2 - The MovieClip instances to check for collision.
alphaTolerance - a number from 0 to 255 that specifies the transparency tolerance when testing the collision. A higher number will increase the tolerance (ie. allow more transparent parts of the MovieClip to register collisions). Defaults to 255.
Returns a Rectangle object specifying the intersection of the two MovieClips in the _root coordinate space, or null if they do not intersect.

http://www.gskinner.com/blog/archives/2005/10/source_code_sha.html

1 Comment »

  1. very good class!

    Comment by Stanislav Stankov — October 20, 2007 @ 2:52 pm

RSS feed for comments on this post. | TrackBack URI
You can also bookmark this on del.icio.us or check the cosmos

Leave a comment





XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .