From c474a43f800c7e7a0a90adcc997ba4e30dd2ae56 Mon Sep 17 00:00:00 2001 From: quou Date: Tue, 1 Oct 2024 23:00:58 +1000 Subject: enum for specials --- obj.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'obj.h') diff --git a/obj.h b/obj.h index c7d9589..4f7d57e 100644 --- a/obj.h +++ b/obj.h @@ -13,6 +13,16 @@ typedef enum { face_right } Face; +#define specials_xmacro \ + x(special_gun, 21, 0) + +typedef enum { +#define x(name, x, y) name, + specials_xmacro +#undef x + special_count +} Special; + typedef struct { int x, y, vx, vy; int frame; @@ -22,6 +32,7 @@ typedef struct { int inv, hp, charge; Face face; Rect rect; + Special spec; } Player; void init_player(Player* p); -- cgit v1.2.3-54-g00ecf