apply_bonuses();
scrolling_timer.init(true);
+ bullets_timer.init(true);
}
World::World(const std::string& subset, int level_nr)
apply_bonuses();
scrolling_timer.init(true);
+ bullets_timer.init(true);
}
void
void
World::add_bullet(float x, float y, float xm, Direction dir)
{
- if(bullets.size() > MAX_BULLETS-1)
+ if(bullets_timer.check())
return;
+ bullets_timer.start(BULLETS_TIMEOUT);
+
Bullet new_bullet;
new_bullet.init(x,y,xm,dir);
bullets.push_back(new_bullet);
std::vector<FloatingScore*> floating_scores;
std::vector<Upgrade> upgrades;
+ Timer bullets_timer;
std::vector<Bullet> bullets;
typedef std::vector<ParticleSystem*> ParticleSystems;
ParticleSystems particle_systems;