In this tutorial, we're going to learn how to create basic AS3 collision detection using the AS3 hitTestObject() method of the MovieClip class. Collision detection refers to the process of checking whether 2 or more objects are hitting each other - if
function mouseUpHandler(evt:MouseEvent):void { var obj = evt.target; // obj.dropTarget will give us the reference to the shape of // the object over which we dropped the circle.
In these situations you’ll have to upgrade your code to work with HitTestPoint, or even more advanced, Matrices. The HitTestObject function requires you to declare a shape that you want to detect a collision with, in my example below – a shape called
Post a Comment:
Showing 0 Comments: