A simple game framework for AI development.
ヽ༼ ಠ益ಠ ༽ノ
Proposed API overview:
// up, down, left and right are self-explanatory, actions contains four
// different inputs that are game specific, e.g. jump or fire.
typedef struct input_s {
float up, down, left, right;
float actions[4];
} input_t;
// A structure generated by the game implementation, the player can't change
// any of the values, they're only for information purposes.
typedef struct game_s {
int screen_width, screen_height;
float* screen;
int32_t score;
bool game_over;
// Sends a new input to the game and requests a new state to be written
// into <game>.
void (*_update)(game_t* game, input_t input, void* internal_game_state);
void* _internal_game_state;
} game_t;
void update(game_t* game, input_t input) {
game->_update(game, input, game->internal_game_state);
}