#pragma once #include "loader.h" struct entity { int (*update)(struct entity *self); int (*hurt)(struct entity *self, int damage); int (*draw)(struct entity *self, int camx, int camy); int x, y; // unsigned results in a bunch of weird edge cases struct velocity { signed x, y; } velocity; struct hitbox { unsigned left, right, top, bottom; } hitbox; struct anim { unsigned frame; SDL_Rect rect; unsigned length; } anim; unsigned state; int hp; int timer; int iframes; signed facing; void *texture; void *ext; };