diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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(); } |