From ee316a07cdfb01e52694edef2cc998e672e2885b Mon Sep 17 00:00:00 2001 From: zlago Date: Sat, 26 Oct 2024 20:21:15 +0200 Subject: redo the damage system --- src/entity.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/entity.h') diff --git a/src/entity.h b/src/entity.h index 33aca68..038b62a 100644 --- a/src/entity.h +++ b/src/entity.h @@ -28,9 +28,13 @@ enum factions { FACTION_ENEMY, }; +struct damage { + int damage, iframes; +}; + struct entity { int (*update)(struct entity *self); - int (*hurt)(struct entity *self, int damage); + int (*hurt)(struct entity *self, struct damage damage); int (*draw)(struct entity *self, int camx, int camy); void (*free)(struct entity *self); int x, y; // unsigned results in a bunch of weird edge cases -- cgit 1.4.1-2-gfad0