Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Creep *creep = dynamic_cast<Creep*>(itemsInRange.at(0));
- double lowestHp = creep->getCurrentHp();
- int index = 0;
- for(QList<QGraphicsItem*>::iterator it = itemsInRange.begin(); it != itemsInRange.end(); ++it, ++i) {
- if(dynamic_cast<Creep*>(*it)->getCurrentHp() < lowestHp)
- lowestHp = dynamic_cast<Creep*>(*it)->getCurrentHp();
- index = i;
- }
- /* attack target with lowest hp*/
- Antibody antibody;
- antibody.setPos(towerMid);
- map()->addItem(&antibody);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement