From 2467c7e4e37f7f18c73c7e02400b5e1743358e68 Mon Sep 17 00:00:00 2001 From: Rommmmaha Date: Thu, 6 Jun 2024 12:15:39 +0300 Subject: [PATCH] . --- client/client.vcxproj | 2 +- client/game.cpp | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/client.vcxproj b/client/client.vcxproj index 752dd16..1ec70b1 100644 --- a/client/client.vcxproj +++ b/client/client.vcxproj @@ -42,7 +42,7 @@ SFML_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true $(SolutionDir)SFML\include - stdcpp20 + stdcpp17 Windows diff --git a/client/game.cpp b/client/game.cpp index ff1e785..a010f38 100644 --- a/client/game.cpp +++ b/client/game.cpp @@ -119,8 +119,11 @@ void game::update() title += std::to_string(number_of_enemies - 2); title += " | "; title += std::to_string(int(percentage)); - title += "% < 90% | FPS: "; - title += std::to_string(fps); + title += "% < 90% | FPS-lock: "; + if (fps == 0) + title += "OFF"; + else + title += std::to_string(fps); _RenderWindow->setTitle(title); } @@ -162,15 +165,19 @@ void game::update() return; case sf::Keyboard::PageDown: --scale; - scale = scale < 1 ? 1 : scale; + scale = scale < 5 ? 5 : scale; needInitialization = true; return; case sf::Keyboard::Equal: ++fps; + if (fps < 10) + fps = 10; _RenderWindow->setFramerateLimit(fps); break; case sf::Keyboard::Dash: --fps; + if (fps < 10) + fps = 0; _RenderWindow->setFramerateLimit(fps); break; case sf::Keyboard::Space: @@ -181,10 +188,6 @@ void game::update() } } } - if (fps < 0) - fps = 0; - if (scale < 1) - scale = 10; // Color gradients float speed = 30; float hue = _Clock.getElapsedTime().asSeconds() * speed; @@ -225,6 +228,7 @@ void game::update() { // Creating path map[pos2index(player.x, player.y, map_size.x)] = 2; + // Adding Neighbours switch (player.direction) { @@ -252,10 +256,8 @@ void game::update() if (map[pos2index(player.previous.x, player.previous.y, map_size.x)] == 2) { for (size_t i = 0; i < map_size.z; ++i) - { if (map[i] == 2) map[i] = 1; - } update_tmp_map(); std::vector left, right;