blob: 18c8964cfd86850ef4e62f34b8eb09ec9f73f051 (
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
32
33
34
35
36
37
38
39
|
#define BULLET_SIZE 2
#define ENTITY_SIZE 16
typedef struct {
float pos[2];
float size[2];
float vel[2];
} Body;
typedef struct {
enum {
EPLAYER,
EGHOST,
EBULLET,
} type;
bool active;
Body body;
float time;
} Entity;
typedef struct {
Entity *self;
Entity *target;
} EntityCollision;
typedef void (EntityCollisionProc)(Entity *self, Entity *other);
void entphysics(float delta);
void enqcoll(EntityCollision *c);
EntityCollision *deqcoll(void);
extern Entity entitybuffer[2048];
extern int ebufi;
extern char map_data[];
extern int map_width, map_height;
|