aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp58
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;
+}