0 Members and 1 Guest are viewing this topic.
int j = 0; for (j = 0; j < shotVector.size(); j++) { shotVector[j].Move(-speedShot * sin(directionVector[j] * radian), -speedShot * cos(directionVector[j] * radian)); if(shotVector[j].GetPosition().x < -50 || shotVector[j].GetPosition().x > width || shotVector[j].GetPosition().y < 100 || shotVector[j].GetPosition().y > height) { shotVector[j].erase(shotVector.begin()+j); // <----- LINE 169 } }
shotVector.erase(shotVector.begin() + j);