aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
blob: 20a6cdcacb94766d5a279f0731d6fd7760300c00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#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;
                game->start();
            }
            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->getKeys();
            game->draw();
            break ;
        }
        case (ENDING):
        {
            DrawText("GOOD BYE SCREEN", 20, 20, 40, LIGHTGRAY);
            break ;
        }
    }
    EndDrawing();
  }
  CloseWindow();
  return 0;
}