//Enemy projectile collide
collideCounter = 0;
for (iter2 = projArray.begin(); iter2 != projArray.end(); iter2++){
collideCounter2 = 0;
for (iter3 = projArray.begin(); iter3 != projArray.end(); iter3++){
if (projArray[collideCounter].rect.getGlobalBounds().intersects(enemy.enemyArray[collideCounter2].enemySprite.getGlobalBounds()))
{
std::cout << "COLLIDE" << std::endl;
}
collideCounter2++;
}
collideCounter++;
}
Seems to be the 2nd for loop giving me the subscript out of range. I have no idea where to start looking, it could be the amount of bullets that are being spawned because if I click my mouse fast, it will only spawn a few bullets instead of like 8-10 so maybe its conflicting with the collision but I'm not sure, only this part of the code is giving me the error.