diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-01-02 20:29:46 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-01-02 20:29:46 +0100 |
commit | 30e2f2436fb1bdc688101e97f65ec1cf49ddb35d (patch) | |
tree | dcd31c2c405b55a9c301f89eda71434e1c3e6a31 /src/main.cpp | |
download | threshold-30e2f2436fb1bdc688101e97f65ec1cf49ddb35d.tar.gz threshold-30e2f2436fb1bdc688101e97f65ec1cf49ddb35d.tar.bz2 threshold-30e2f2436fb1bdc688101e97f65ec1cf49ddb35d.tar.xz threshold-30e2f2436fb1bdc688101e97f65ec1cf49ddb35d.tar.zst threshold-30e2f2436fb1bdc688101e97f65ec1cf49ddb35d.zip |
initial commit
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..f5a27af --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,58 @@ +#include "window.hpp" +#include "gameplay.hpp" +#include <iostream> + +gameState gs = TITLE; + +Game* game = new Game; + +int main(void) { + initWindow(); + + // Main game loop + while (!WindowShouldClose()) /* Detect window close button or ESC key */ + { + switch (gs) { + case (TITLE): + { + if (IsKeyPressed(KEY_ENTER)) + { + gs = GAMEPLAY; + } + break ; + } + case (GAMEPLAY): + { + break ; + } + case (ENDING): + { + break ; + } + } + BeginDrawing(); + + ClearBackground(RAYWHITE); + + switch (gs) { + case (TITLE): + { + DrawText("LOGO SCREEN", 20, 20, 40, LIGHTGRAY); + break ; + } + case (GAMEPLAY): + { + game->start(); + break ; + } + case (ENDING): + { + DrawText("GOOD BYE SCREEN", 20, 20, 40, LIGHTGRAY); + break ; + } + } + EndDrawing(); + } + CloseWindow(); + return 0; +} |