diff options
author | zlago | 2024-09-30 10:52:14 +0200 |
---|---|---|
committer | zlago | 2024-09-30 10:52:14 +0200 |
commit | 45512bbc85188e3adb4eda597d0d2fa5530de651 (patch) | |
tree | 3d159b6baad17c828e42f4594353599b879cb2c8 /src/entity.h | |
parent | 5ead22e91fe1165f3a9208c0d1c965b3edd104be (diff) |
player animations
Diffstat (limited to 'src/entity.h')
-rw-r--r-- | src/entity.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/entity.h b/src/entity.h new file mode 100644 index 0000000..5b34bac --- /dev/null +++ b/src/entity.h @@ -0,0 +1,28 @@ +#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; +}; |