From 5db38a926ed943932b40c2d283a57b2e2bcd20ad Mon Sep 17 00:00:00 2001 From: lukel495 Date: Mon, 27 Nov 2023 08:57:32 +0100 Subject: [PATCH] added yf time to json Nils Lukas Arvid Stina --- assets/data.json | 3 ++- src/States.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/data.json b/assets/data.json index 7e8b395..ecbd6de 100644 --- a/assets/data.json +++ b/assets/data.json @@ -28,7 +28,8 @@ "game_constants": { "bottles_per_second" : 2, - "game_time" : 20 + "game_time" : 20, + "yf_per_second": 0.125 }, "map": diff --git a/src/States.cc b/src/States.cc index af793b7..48ac63f 100644 --- a/src/States.cc +++ b/src/States.cc @@ -105,7 +105,7 @@ void Game_state::update(Context &context) bottles.push_back(std::make_unique(bottle_texture, data["bottle"])); time_since_last_bottle = 0; } - if (time_since_last_yf >= 8) + if (time_since_last_yf >= 1 / static_cast(data["game_constants"]["yf_per_second"])) { yf.push_back(std::make_unique(YF_texture)); if(yf.size() > 1) -- 2.30.2