HOW MANY TIMES TO I HAVE TO FIX YOU, YOU FUCKER

This commit is contained in:
Thomas R 2022-01-13 10:52:02 +01:00
parent 5efd728e9b
commit 5e86872324
No known key found for this signature in database
GPG Key ID: E538821A6CDFDAD7

View File

@ -112,16 +112,15 @@ void Game::remCollidingProjectiles(){
while(tor != torpedos.end()){ while(tor != torpedos.end()){
// missiles can't be right under torpedos, so that must means they are colliding in Y // missiles can't be right under torpedos, so that must means they are colliding in Y
if(miss->getY() + confData.missilesLength < tor->getY()){ if(miss->getY() + confData.missilesLength > tor->getY()){
if(areLinesColliding( // now check if they collide in X
} miss->getX(), miss->getX() + confData.missilesWidth,
if(areLinesColliding( // now check if they collide in X tor->getX(), tor->getX() + confData.torpedosWidth)){
miss->getX(), miss->getX() + confData.missilesWidth, missiles.erase(miss);
tor->getX(), tor->getX() + confData.torpedosWidth)){ torpedos.erase(tor);
missiles.erase(miss); wasColliding = true;
torpedos.erase(tor); break;
wasColliding = true; }
break;
} }
++tor; ++tor;
} }