I have these movieclips on stage, called Seekers. What I’m trying to do is say “If these Seekers touch each other, they should clump together” Now, I have them in a larger array with other elements and also their own array.
What I tried to do was have a loop nested in a loop of two different indexes.
public function checkSmash()
{
var c = 0;
var n = 0;
while (c<seekerList.length)
{
if (seekerList[c] is Seeker)
{
while (n<seekerList.length)
{
if (seekerList[c].hitTestObject(seekerList[n])
{
//I don't know.
}
n++;
}
}
c++;
}
}
My problem is this:
I don’t know how to express the “clump together” part of it.
I don’t think my double loop will work right. It would act twice for each Seeker whereas I only want it to act once.
If anyone could help me out that would be great. Thanks.