#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, LASTEntity, } type; bool active; Body body; float time; } Entity; typedef struct { Entity *self; Entity *target; } EntityCollision; typedef void (EntityCollisionProc)(Entity *self, Entity *other); typedef void (EntityUpdateProc)(Entity *self, float delta); void entphysics(float delta); void entupdate(float delta); void entinit(void); void enqcoll(EntityCollision *c); EntityCollision *deqcoll(void); Entity *allocentity(void); void freeentity(Entity *); extern Entity entitybuffer[2048]; extern int ebufi; extern char map_data[]; extern int map_width, map_height; extern Entity *player; extern bool shot; extern int shotx, shoty; extern bool moveleft, moveright, moveup, movedown;