works, not done
This commit is contained in:
parent
b07cee75ce
commit
5be8f91587
2 changed files with 14 additions and 6 deletions
20
main.c
20
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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue