RyanHub - file viewer
filename: include/engine.h
branch: main
back to repo
// engine.h

#ifndef GAME_H
#define GAME_H

#include "player.h"
#include "thing.h"
#include "renderer.h"

// include all default operations for developer use
#include "physics.h"
// default render, physics, movement, etc later

// gives access to map generator
#include "map.h"

#define MAX_PLAYERS 8

typedef struct {
    Player players[MAX_PLAYERS];
    int player_count;
} GameState;

extern GameState g_game_state; // expose globally

void engine_init();
void engine_update(float dt);
void poll_inputs();
void update_state();
void render_frame();
void engine_reset();

// return 1 or 0, -1 for error
int engine_button_down(int player_id, char button);
int engine_button_pressed(int player_id, char button);
int engine_button_released(int player_id, char button);

// return float -1.0 to 1.0
float engine_joystick_x(int player_id);
float engine_joystick_y(int player_id);

const char* engine_last_message(int player_id);


#endif