Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MyViewer::update_bullets() {
- int i = 0;
- bullet_list = bullet::getList();
- for (std::vector<bullet *>::iterator it = bullet_list.begin(); it != bullet_list.end(); ) {
- for (std::vector<collision *>::iterator it_b = buildings.begin(); it_b != buildings.end(); ++it_b) {
- if ((*it_b)->contains((*it)->getPos(), 0.05f)) {
- (*it)->setAge(1500000);
- }
- }
- if ((*it)->getAge() > 150) {
- bullet_group->remove(i + 1);
- it = bullet_list.erase(it);
- }
- else {
- (*it)->update();
- ++it;
- }
- ++i;
- }
- bullet::setList(bullet_list);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement