24 lines
570 B
C
24 lines
570 B
C
#pragma once
|
|
#include <gint/display.h>
|
|
|
|
struct Entity {
|
|
int x;
|
|
int y;
|
|
int hb_x;
|
|
int hb_y;
|
|
int hb_w;
|
|
int hb_h;
|
|
int layer;
|
|
color_t hb_color;
|
|
};
|
|
|
|
#define ENTITY_GRID_SIZE 256
|
|
extern struct Entity *g_entity_grid[ENTITY_GRID_SIZE];
|
|
|
|
void entity_init(void *restrict entity, int x, int y, int hb_x, int hb_y,
|
|
int hb_w, int hb_h, int layer, color_t hb_color);
|
|
void entity_deinit(void *restrict entity);
|
|
void entity_draw_hitbox(void *restrict entity);
|
|
void entity_grid_draw_hitboxes(void);
|
|
struct Entity *entity_collide(void *restrict entity, int mask);
|