/** ************************************************************************* */
/** ****************** MAIN-METHOD: CHECKING COLLISION ********************** */
/** ************************************************************************* */
public void checkCollision() {
SpriteGroup group1 = this.getGroup1(), group2 = this.getGroup2();
if (!group1.isActive() || !group2.isActive()) {
// one of the group is not active
return;
}
Sprite[] member1 = group1.getSprites(), // group one members
member2 = group2.getSprites();
int size1 = group1.getSize(), // size of non-null members
size2 = group2.getSize();
Sprite sprite1, sprite2; // sprite reference
CollisionShape shape1, shape2; // sprite collision rect