for(int i=0;i < actors.size(); i++) { actors.at(i)->show((int)actors.at(i)->xpos, (int)actors.at(i)->ypos, *screen); if(shootTick > 50) { if(actors.at(i)->xpos <= player->xpos+5 && actors.at(i)->xpos >= player->xpos-5) { actors.at(i)->shoot(false); } shootTick = 0; }