From: stian853 Date: Mon, 27 Nov 2023 07:43:50 +0000 (+0100) Subject: fixed yf, stina arvid X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=c0b0f6d509681a979d22f57277a50a314771b2ee;p=TDDC76_proj.git fixed yf, stina arvid --- diff --git a/src/States.cc b/src/States.cc index 95cba14..7cc5c5d 100644 --- a/src/States.cc +++ b/src/States.cc @@ -76,18 +76,20 @@ void Game_state::update(Context &context) } 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_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_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);