summaryrefslogtreecommitdiff
path: root/lib/world.h
blob: 40c3fef4c86857eb5746b13b22e8841293421c98 (plain)
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
#define WORLD_MAX_ENTITIES 5000

enum {
	ENTITY_NONE,
	ENTITY_BALL
};

struct entity_ball {
	vec2 pos;
	vec2 vel;
};

union entity_union {
	struct entity_ball ball;
};

struct entity {
	int kind;
	union entity_union e;
};

struct world;

struct world *dp_world_create();
void dp_world_free(struct world *);

int dp_world_create_entity(struct world *, int kind);
struct entity *dp_world_find_entity(struct world *, int entity_id);
int dp_world_remove_entity(struct world *, int entity_id);

int dp_world_tick(struct world *, double delta);