From 30e2f2436fb1bdc688101e97f65ec1cf49ddb35d Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Sun, 2 Jan 2022 20:29:46 +0100 Subject: initial commit --- src/main.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/main.cpp (limited to 'src/main.cpp') 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 + +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; +} -- cgit v1.2.3