From e1700eb7aaaffe3986980adb5ab05525ecbc4d43 Mon Sep 17 00:00:00 2001 From: esquizo Date: Wed, 29 Apr 2026 22:49:33 -0300 Subject: organizado arquivos --- dat.h | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'dat.h') diff --git a/dat.h b/dat.h index f0e4283..18c8964 100644 --- a/dat.h +++ b/dat.h @@ -1,8 +1,39 @@ +#define BULLET_SIZE 2 +#define ENTITY_SIZE 16 + + typedef struct { float pos[2]; float size[2]; float vel[2]; } Body; -int checkcollision(Body *b1, Body *b2); -void resolvecoll(Body *b1, Body *b2, float p[2]); +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; -- cgit v1.2.3