01147c0d35
* Implement a simple state machine to simulate different game stats * Create a generic menu to display different menus * Update the Makefile for TTF support * Draw a simple diagram to show the stats
35 lines
546 B
C
35 lines
546 B
C
|
|
#ifndef STATES_H
|
|
#define STATES_H
|
|
|
|
#include "config.h"
|
|
|
|
// All possible game states are defined in config.h
|
|
|
|
|
|
// A single game state
|
|
struct gameState {
|
|
void(*drawFun)();
|
|
void(*handleEventsFun)();
|
|
};
|
|
|
|
struct gameState stateTable[MAX_STATES];
|
|
|
|
// State Functions prototypes
|
|
void displayMainmenu();
|
|
void displayNumplayers();
|
|
void displayCredits();
|
|
void displayRunninggame();
|
|
void displayRlyquit();
|
|
|
|
void eventsMainmenu();
|
|
void eventsNumplayers();
|
|
void eventsCredits();
|
|
void eventsRunninggame();
|
|
void eventsRlyquit();
|
|
|
|
void exitGame();
|
|
|
|
#endif
|
|
|