summaryrefslogtreecommitdiffhomepage
path: root/main.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-17 01:07:35 +0200
committerAki <please@ignore.pl>2022-04-17 01:34:10 +0200
commit28ed6105138e43b50ed2ef88ed08d09d48d9d660 (patch)
tree9121155c7dbbe3020fa625c4e25dc48299038b2a /main.cpp
parenteb90e2e2d220b770f6b59dfad4315b477901a24d (diff)
downloadbullethell2022-28ed6105138e43b50ed2ef88ed08d09d48d9d660.zip
bullethell2022-28ed6105138e43b50ed2ef88ed08d09d48d9d660.tar.gz
bullethell2022-28ed6105138e43b50ed2ef88ed08d09d48d9d660.tar.bz2
Fleshed out skeleton with Game and Screen classes
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index 6b7a251..9f216e5 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,24 +1,31 @@
-#include "raylib.h"
+#include <memory>
+
+#include <raylib.h>
#ifdef PLATFORM_WEB
#include <emscripten/emscripten.h>
#endif
+#include "Game.h"
+#include "TitleScreen.h"
+
+
+static Game s_game;
+
void Loop();
int main()
{
- InitWindow(800, 600, "bullethell2022");
+ InitWindow(800, 600, "Bullet Hell 2022");
+ s_game.set(std::make_unique<TitleScreen>());
#ifdef PLATFORM_WEB
emscripten_set_main_loop(Loop, 0, 1);
#else
SetTargetFPS(60);
while (!WindowShouldClose())
- {
Loop();
- }
#endif // PLATFORM_WEB
CloseWindow();
}
@@ -26,8 +33,8 @@ int main()
void Loop()
{
+ s_game.update(GetFrameTime());
BeginDrawing();
- ClearBackground(RAYWHITE);
- DrawText("bullethell2022", 190, 200, 20, LIGHTGRAY);
+ s_game.draw();
EndDrawing();
}