}
time_since_last_bottle += context.time.asSeconds();
time_since_last_yf += context.time.asSeconds();
- //std::cout << std::fixed << std::setprecision(3) << time_since_last_bottle << std::endl;
if (time_since_last_bottle >= data["game_constants"]["bottles_per_second"])
{
bottles.push_back(std::make_unique<Bottle>(bottle_texture, data["bottle"]));
- //std::cout << "placed bottle"<< std::endl;
time_since_last_bottle = 0;
}
- if (time_since_last_yf >= 5)
+ if (time_since_last_yf >= 8)
{
yf.push_back(std::make_unique<YF>(YF_texture));
- std::cout << "yf spawned"<< std::endl;
+ if(yf.size() > 1)
+ {
+ yf.erase(yf.begin());
+ }
time_since_last_yf = 0;
+
}
game_map.update(context);
player->update(context);