diff options
author | zlago | 2024-09-29 22:45:59 +0200 |
---|---|---|
committer | zlago | 2024-09-30 08:00:53 +0200 |
commit | 5ead22e91fe1165f3a9208c0d1c965b3edd104be (patch) | |
tree | e65535660d507fcfd17cfa75bf59ddc58ae46c94 /src/main.h | |
parent | e304b0a4acc3f0870f55e6b584c464096333dfdc (diff) |
player entity
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/main.h b/src/main.h index 0595b37..26c4cf1 100644 --- a/src/main.h +++ b/src/main.h @@ -1,3 +1,23 @@ -//#include <SDL2/SDL.h> -extern void /*SDL_Window*/ *window; -extern void /*SDL_Renderer*/ *renderer; +#include <SDL2/SDL.h> +extern SDL_Window *window; +extern SDL_Renderer *renderer; + +extern unsigned input_now; + +extern 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; + unsigned state; + int hp; + int timer; + void *texture; + void *ext; +} player[1]; |