예제 #1
0
파일: Bonus.cpp 프로젝트: tolsac/bomberman
void	Bonus::doBonus(IA& bomberman)
{
  if (this->bonus == SPEEDADD)
    bomberman.setSpeed(bomberman.getSpeed() + 1);
  if (this->bonus == PORTEE)
    bomberman.setPortee(bomberman.getPortee() + 1);
  if (this->bonus == BOMBNB)
    bomberman.setStockBomb(bomberman.getStockBomb() + 1);
}
예제 #2
0
IA  *XmlLoad::createAI(tinyxml2::XMLElement *ai, int width, int height) const {
  IA  *newAI;

  newAI = new IA(this->getUnIntValue(ai, "position"),
		 static_cast<eDifficulty>(this->getIntValue(ai, "difficulty")),
		 width, height);
  newAI->setMaxBombs(this->getIntValue(ai, "maxBombs"));
  newAI->setState(this->getBoolValue(ai, "state"));
  newAI->setDirection(static_cast<eDirection>(this->getIntValue(ai, "direction")));
  newAI->setSpeed(this->getFloatValue(ai, "speed"));
  newAI->setRangeBomb(this->getUnIntValue(ai, "rangeBomb"));
  newAI->setTexturePath(std::string(ai->FirstChildElement("texture")->GetText()));
  newAI->setBombs(this->createBombs(ai->FirstChildElement("bombs")));
  return (newAI);
}