__________________
Senast redigerad av qpB 2013-12-11 kl. 19:22.
Senast redigerad av qpB 2013-12-11 kl. 19:22.
void GameEntity :: bulletCollision() { for (int x = 0; x < bCount; x++) { //GETS CURRENT BULLETS RECTANGLE pShot[x]->getBoundingBox(&bRect); for (int i = 0; i < capacity; i++) { //GET ENEM SHIPS RECTANGLE eShip[i]->getBoundingBox(&eRect); //CHECK IF TWO RECTANGLES COLLIDES if (bRect.Intersect(&eRect)) { //UPDATE PLAYER SCORE pShip->setPlayerScore(); posY = -80.0f; posX = hge->Random_Float(0, mScreenMaxHeight - 70.0f); speed = (hge->Random_Float(0.5, 2.5)); delete eShip[i]; eShip[i] = new Enemy(eTexture, posX, speed); delete pShot[x]; pShot[x] = pShot[bCount - 1]; //NEXT LINE TO BE EXECUTED bCount--; } } } }
if (bulletHit == true) { delete pShot[x]; pShot[x] = pShot[bCount - 1]; bCount--; }
Du måste vara medlem för att kunna kommentera
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106