daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Sep 21st, 2018 66 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1.     // Get an array containing all active Players in the game
  2.     std::map<int, Entity*> temp;
  3.     dynamic_cast<MainGame*>(_state)->getGameObjectManager().getGroup(Entity::entityName::entityPlayer, temp);
  4.  
  5.     //Check to see if any of these bullets are colliding with the enemy object.
  6.     std::map<int, Entity*>::const_iterator itrr = temp.begin();
  7.     while(itrr != temp.end())
  8.     {
  9.         if(GetBoundingRect().intersects(itrr->second->GetBoundingRect()))
  10.         {
  11.             toggleDeath();
  12.         }
  13.         itrr++;
  14.     }
  15.  
  16.     // Get an array containing all active bullets in the game
  17.     std::map<int, Entity*> tempArray;
  18.     dynamic_cast<MainGame*>(_state)->getGameObjectManager().getGroup(Entity::entityName::entityBullet, tempArray);
  19.  
  20.     //Check to see if any of these bullets are colliding with the enemy object.
  21.     std::map<int, Entity*>::const_iterator itr = tempArray.begin();
  22.     while(itr != tempArray.end())
  23.     {
  24.         if(itr->second->GetBoundingRect().intersects(GetBoundingRect()))
  25.         {
  26.             toggleDeath();
  27.             itr->second->alive = false;
  28.             _Player->addScore(pointValue);
  29.             _Player->addXP(pointValue);
  30.         }
  31.         itr++;
  32.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top