summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-11-07 20:44:27 +0100
committerAki <please@ignore.pl>2022-11-07 20:44:27 +0100
commitf4e80b726ad306a4ea8a5921e0829b7f003f431f (patch)
treea2c15982f43d4f5f67eee093157173a485c0961e
parent04d7f1ecf6f78f64c37001b6f3471bdb90b0b246 (diff)
downloadkurator-f4e80b726ad306a4ea8a5921e0829b7f003f431f.zip
kurator-f4e80b726ad306a4ea8a5921e0829b7f003f431f.tar.gz
kurator-f4e80b726ad306a4ea8a5921e0829b7f003f431f.tar.bz2
Simplified currently available scenes pool
-rw-r--r--kurator/CMakeLists.txt1
-rw-r--r--kurator/src/GameOver.cpp35
-rw-r--r--kurator/src/GameOver.h24
-rw-r--r--kurator/src/SkyboxTest.cpp8
-rw-r--r--kurator/src/Title.cpp11
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);
}