diff --git a/MyGame b/MyGame index 6928992..d0f1a44 100755 Binary files a/MyGame and b/MyGame differ diff --git a/main.c b/main.c index ad5fad7..bad0371 100644 --- a/main.c +++ b/main.c @@ -91,6 +91,12 @@ bool IsPlayerColliding(struct DoublePipe* double_pipe, struct Birdie* bird) { return CheckCollisionCircleRec(center, bird_radius, rec1) || CheckCollisionCircleRec(center, bird_radius, rec2); } +enum GameState { + Start, + Game, + Restart +}; + enum GameState MainGame(struct DoublePipe* double_pipe, struct Birdie* bird, int pipe_height, int pipe_gap) { if (!IsPlayerColliding(double_pipe, bird)) { ClearBackground(BLACK); @@ -106,10 +112,8 @@ enum GameState MainGame(struct DoublePipe* double_pipe, struct Birdie* bird, int return Game; } -enum GameState { - Start, - Game, - Restart +enum GameState StartGame() { + } int main(void) { @@ -124,11 +128,15 @@ int main(void) { while (!WindowShouldClose()) { BeginDrawing(); - switch (GameState) { + switch (gs) { case Game: MainGame(&double_pipe, &bird, pipe_height, pipe_gap); + break; case Restart: - //func for restart + break; + case Start: + MainGame(&double_pipe, &bird, pipe_height, pipe_gap); + break; } EndDrawing();