how do I check hitTest with 2 objects from same class?
I have an object (lets call it circle) and I want to check when this circle hits other circles.
I spawned them in through a Main.as using addChild(circle1) then set the location to each one:
var circle1:Circle = new Circle();
circle1.x = 0.0
circle1.y = 0.0
Right now how I have the code working is:
if(circle1.hitTestObject(circle2))
{
// do something
}
But I have to check each circle to hitTest with every other circle, which takes a long time.
ex:
if(circle1.hitTestObject(circle2))
if(circle1.hitTestObject(circle3))
if(circle1.hitTestObject(circle4))
if(circle1.hitTestObject(circle5))
Is there some way I can have my Circle() class hitTest other Circle() classes?
Or maybe create an array of circles and hitTest those objects against each other?
