Free ActionScript

Home

AS3 Scripts

AS2 Scripts

Resources

About

Contact

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

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

Update AS3 version of this script is available here: http://www.freeactionscript.com/2011/08/as3-pixel-perfect-collision-detection/

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.

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.

Oh, ok

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?

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

Ok thanks

HI pradvan,

I created a very nice maze, using your script. Thanks for that. Now I encountered a problem with exporting. This movie is loaded into an html file, which shows the movie 100% width and height in the browser window. and now the collision detection doesn’t work anymore… Any idea?

Hi wietse,

Try using noscale: Stage.scaleMode=”noScale”;

If you need it to work while scaled, the script would require changes. If that’s the case, please try seeking help on forums. There are links to some good ones on the resources page.

Thanks, PR

Hi, I was wondering if there is a way to make your collision code work when scaling a swf? I’m working with as2.

Spitty December 18, 2012 at 12:56 pm Sorry, totally neglected to read the post above this. Thanks for the code though! Log in to Reply

Sorry, totally neglected to read the post above this. Thanks for the code though!

Thank you very much, it works perfectly !

You must be logged in to post a comment.

AS3 Effects

AS3 Gadgets

Game Examples AS2 Effects Animated Effects Dynamic Enemy AI Game Engine Game Weapons Images Interface Math Security

Effects Animated

Effects Dynamic

Enemy AI

Game Engine

Game Weapons

Images

Interface

Math

Security

Game Examples AS3 Basics Bitmap Blitting Collision Detection Enemy AI Movement Physics Space Shooter User Interface Weapon System

Basics

Bitmap Blitting

Collision Detection

Movement

Physics

Space Shooter

User Interface

Weapon System

Site Updates

718Hosting.com

Actionscript.org Forums

Flash Game Blogs

Flash Game License

Flashkit Forums

gotoAndLearn

IndieGames.com

Kirupa’s Tutorials

Kongregate Forums

MochiAds Resources

Philip Radvan

Photon Storm

Polygonal

Radvan Media

Tonypa’s Tutorials

Register

Log in

Entries RSS

Comments RSS

WordPress.org