diff options
-rw-r--r-- | kurator/CMakeLists.txt | 1 | ||||
-rw-r--r-- | kurator/src/GameOver.cpp | 35 | ||||
-rw-r--r-- | kurator/src/GameOver.h | 24 | ||||
-rw-r--r-- | kurator/src/SkyboxTest.cpp | 8 | ||||
-rw-r--r-- | kurator/src/Title.cpp | 11 |
5 files changed, 9 insertions, 70 deletions
diff --git a/kurator/CMakeLists.txt b/kurator/CMakeLists.txt index cf37f69..0aa2712 100644 --- a/kurator/CMakeLists.txt +++ b/kurator/CMakeLists.txt @@ -1,7 +1,6 @@ project(kurator) add_executable( ${PROJECT_NAME} - src/GameOver.cpp src/main.cpp src/Session.cpp src/Skybox.cpp diff --git a/kurator/src/GameOver.cpp b/kurator/src/GameOver.cpp deleted file mode 100644 index 9646c17..0000000 --- a/kurator/src/GameOver.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "GameOver.h" - -#include <memory> -#include <utility> - -#include <raylib.h> - -#include "Session.h" - - -namespace kurator -{ - - -GameOver::GameOver(std::shared_ptr<Session> _session) : - session {std::move(_session)} -{ -} - - -void -GameOver::update(const float) -{ -} - - -void -GameOver::draw() const -{ - ClearBackground(GRAY); - DrawText("Bye", 100, 100, 20, BLACK); -} - - -} // namespace kurator diff --git a/kurator/src/GameOver.h b/kurator/src/GameOver.h deleted file mode 100644 index 70b5c31..0000000 --- a/kurator/src/GameOver.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include <memory> - -#include "Session.h" -#include "Scene.h" - - -namespace kurator -{ - - -class GameOver : public Scene -{ -public: - explicit GameOver(std::shared_ptr<Session> _session); - void update(float dt) override; - void draw() const override; -private: - std::shared_ptr<Session> session; -}; - - -} // namespace kurator diff --git a/kurator/src/SkyboxTest.cpp b/kurator/src/SkyboxTest.cpp index 85809f4..3d8241e 100644 --- a/kurator/src/SkyboxTest.cpp +++ b/kurator/src/SkyboxTest.cpp @@ -5,8 +5,8 @@ #include <raylib.h> -#include "GameOver.h" #include "Session.h" +#include "Title.h" namespace kurator @@ -26,10 +26,8 @@ void SkyboxTest::update(const float) { UpdateCamera(&camera); - if (IsKeyPressed(KEY_SPACE)) { - auto next = std::make_shared<GameOver>(session); - session->set(next); - } + if (IsKeyPressed(KEY_SPACE)) + session->set(std::make_shared<Title>(session)); } diff --git a/kurator/src/Title.cpp b/kurator/src/Title.cpp index 92d0b4d..1ff5a12 100644 --- a/kurator/src/Title.cpp +++ b/kurator/src/Title.cpp @@ -22,10 +22,8 @@ Title::Title(std::shared_ptr<Session> _session) : void Title::update(const float) { - if (IsKeyPressed(KEY_SPACE)) { - auto next = std::make_shared<SkyboxTest>(session); - session->set(next); - } + if (IsKeyPressed(KEY_SPACE)) + session->set(std::make_shared<SkyboxTest>(session)); } @@ -33,7 +31,10 @@ void Title::draw() const { ClearBackground(BLACK); - DrawText("Hey", 100, 100, 20, GRAY); + constexpr const char* text = "Kurator"; + const int width = GetScreenWidth(); + const int title = MeasureText(text, 20); + DrawText(text, (width - title) / 2, 100, 20, GRAY); } |