-
Notifications
You must be signed in to change notification settings - Fork 44
/
minigame.h
62 lines (48 loc) · 1.77 KB
/
minigame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef GAMEJAM2024_MINIGAME_H
#define GAMEJAM2024_MINIGAME_H
#ifdef __cplusplus
extern "C" {
#endif
/***************************************************************
Public Minigame Constants
***************************************************************/
// You need to have one of these structs defined globally for the minigame manager to detect it
typedef struct {
const char* gamename;
const char* developername;
const char* description;
const char* instructions;
} MinigameDef;
/***************************************************************
Public Minigame Functions
***************************************************************/
/*==============================
minigame_end
Use this to mark your minigame as finished
==============================*/
void minigame_end();
/***************************************************************
Internal Minigame Functions
Do not use anything below this line
***************************************************************/
#include <stdbool.h>
typedef struct {
char* internalname;
MinigameDef definition;
void* handle;
void (*funcPointer_init)(void);
void (*funcPointer_loop)(float deltatime);
void (*funcPointer_fixedloop)(float deltatime);
void (*funcPointer_cleanup)(void);
} Minigame;
extern Minigame* global_minigame_list;
extern size_t global_minigame_count;
void minigame_loadall();
void minigame_play(char* name);
void minigame_cleanup();
Minigame* minigame_get_game();
bool minigame_get_ended();
#ifdef __cplusplus
}
#endif
#endif