Archive for March, 2009

ActionScript 3.0 : Shape Based HitTest / Collision Detection

hittest

During one of my flash game development project, I soon found out that I need to use some kind shape based hit test. Yes, basically – in older days of hittest, this can be accomplish with either an insane amount of mini invisible movieclip stacked around the shape of the object, or they do it using some mathematically formula. This is because, the function hitTest doesn’t work exactly like the shape of the movieclip but, takes the entire movieclip as whole.

Well, this tutorial isn’t about the two method above but, a way simpler method to do collision detection based on shape.

Take a good look at the sample flash below in action.

Read the rest of this entry »