summaryrefslogtreecommitdiffhomepage
path: root/main.cpp
diff options
context:
space:
mode:
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();
}