diff options
author | Aki <please@ignore.pl> | 2022-04-17 01:07:35 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-04-17 01:34:10 +0200 |
commit | 28ed6105138e43b50ed2ef88ed08d09d48d9d660 (patch) | |
tree | 9121155c7dbbe3020fa625c4e25dc48299038b2a /main.cpp | |
parent | eb90e2e2d220b770f6b59dfad4315b477901a24d (diff) | |
download | bullethell2022-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.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(); } |