So a game state is something like the start menu vs the play state of a game. I’m used to seeing it as it’s own class, but I guess that can be baked down simpler like below.
I’m thinking in C I’ll just implement a game-state like this
enum GameState {
START_MENU,
PLAY_STATE,
END_SCREEN
}
GameState gameState = START_MENU;
void update(void) {
switch (gameState) {
case START_MENU:
startMenu();
break;
case PLAY_STATE:
playState();
break;
case END_SCREEN:
endScreen();
break;
default:
break;
}
}