aboutsummaryrefslogtreecommitdiff
path: root/components.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2023-05-04 14:10:41 +1000
committerquou <quou@disroot.org>2023-05-04 14:10:50 +1000
commitd61dcdcc384249ec7ea60c9cc18aab9df1f80577 (patch)
tree563e985e6a1f480461177f2c341d70ce5dd1498d /components.h
parentc4ac81cffcf925963acb0c02584ab22626427a73 (diff)
Add shooting.
Diffstat (limited to 'components.h')
-rw-r--r--components.h17
1 files changed, 14 insertions, 3 deletions
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