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,9 +112,7 @@ void Game::remCollidingProjectiles(){
while(tor != torpedos.end()){
// 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,
tor->getX(), tor->getX() + confData.torpedosWidth)){
@ -123,6 +121,7 @@ void Game::remCollidingProjectiles(){
wasColliding = true;
break;
}
}
++tor;
}
/* if it was colling, it was removed and his Position is now replaced by the next.