Need algorithm!

Miscellaneous Forums/General Discussion/Need algorithm!

Oh man, I feel like a complete idiot! I've just been wasting our time!

Each collision set has a set of sprites in it. And those sprites CANNOT be in more than one set at a time! Each set contains sprites with a specific collision ID. And as each sprite can have only one collision ID, it can only be in one set!

The ONLY time duplicate tests becomes an issue is when the user specifies that they want all sprites in a set to collide with eachother. And since that is a special case, and the ONLY one, all I need to do in that case is that standard nested loop where you change the starting point of the inner loop each time, which coincidentally is what Matty first suggested.

ARGH! :-)

I figured this out when implementing PGF's suggestion. I was trying to decide what to name the variable in the sprite and trying to see if I could just work around it, and I realised that I could just use the CollisionID to determine if the sprite was in ListA or ListB. Then I realised what an idiot I was. :-)