Pixel Perfect Collision Detection

Wednesday, May 27th, 2009 | Game Examples AS2, Images

This is a great “pixel perfect bitmap collision detection with rotation” script by Grant Skinner. This is definitely better than hitTest for rotated irregularly shaped objects and bitmap images. Works great with transparent pngs as well.

Preview

Download Fla Sample

Download Fla Sample

Original Bitmap Collision detection class by Grant Skinner
http://www.gskinner.com/blog/archives/2005/10/source_code_sha.html


Tags: , , , , , , , ,

6 Comments to Pixel Perfect Collision Detection

StapledPuppet
August 4, 2009

Hey, I made a mouse maze game ages ago, and now I am making the second in the series, and I want to use pixel perfect collision.

I have been working on it for ages using variations on your code, yet I can’t make the collisions work? I want to make it so when the drag object goes over something, it goes to another frame?

Thanks if you could help.

pradvan
August 4, 2009

Hi Stapled, Unfortunately I don’t have the time to look in to your problem. Please seek help on one of the many flash game development forums listed on the Resources page. Thanks.

StapledPuppet
August 4, 2009

Oh, ok

StapledPuppet
August 4, 2009

I asked on the forums on newgrounds, but someone told me to learn more, which I know I need to do. I just don’t know how to go about learning AS, or whether to learn AS2 or AS3?

pradvan
August 4, 2009

Try these books:
Essential ActionScript 3.0 by Colin Moock
ActionScript 3.0 Design Patterns Programming
ActionScript 3.0 Game Programming University

StapledPuppet
August 4, 2009

Ok thanks

Leave a comment

You must be logged in to post a comment.