From d61dcdcc384249ec7ea60c9cc18aab9df1f80577 Mon Sep 17 00:00:00 2001 From: quou Date: Thu, 4 May 2023 14:10:41 +1000 Subject: Add shooting. --- components.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'components.h') diff --git a/components.h b/components.h index 84cfc54..66304df 100644 --- a/components.h +++ b/components.h @@ -5,6 +5,9 @@ #include "asset.h" #include "rect.h" +/* Components are POD. If you put a pointer in one of these, + * you're a dumb poo poo head. */ + typedef struct { int x, y; } CPosition; @@ -21,10 +24,18 @@ typedef struct { int timer; } CAnimated; +typedef struct { + int life; + int vx, vy; +} CBullet; + typedef enum { - ctype_sprite = 1 << 0, - ctype_position = 1 << 1, - ctype_animated = 1 << 2 + ctype_sprite = 1 << 0, + ctype_position = 1 << 1, + ctype_animated = 1 << 2, + ctype_bullet = 1 << 3, + ctype_player_bullet = 1 << 4, + ctype_enemy_bullet = 1 << 5 } CType; #endif -- cgit v1.2.3-54-g00ecf