From 9102b190c8750c09f6c5186522618c55bf490523 Mon Sep 17 00:00:00 2001 From: Trevor Boddy Date: Tue, 16 Aug 2022 22:54:50 -0400 Subject: [PATCH] cleanup --- src/bullets.h | 20 -------------------- src/global.h | 21 --------------------- src/main.c | 1 + src/structs.h | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 41 deletions(-) create mode 100644 src/structs.h diff --git a/src/bullets.h b/src/bullets.h index daf58d1..ae179fc 100644 --- a/src/bullets.h +++ b/src/bullets.h @@ -1,25 +1,5 @@ // bullets -#define BULLET_COUNT 64 - -struct bullet { - bool active, player; - fix16 speed; - fix32 dist; - Vect2D_f16 pos, vel; - s16 angle, clock; - Sprite* image; - bool dead, big; - void (*updater)(s16); - bool bools[COUNT_INT]; - s16 ints[COUNT_INT]; - fix16 fixes[COUNT_INT]; -}; -struct bullet bullets[BULLET_COUNT]; - - -// lifecycle - #define BULLET_OFF 4 #define BULLET_OFF_BIG 8 diff --git a/src/global.h b/src/global.h index 8c74bf3..0071073 100644 --- a/src/global.h +++ b/src/global.h @@ -26,25 +26,4 @@ u32 score, s16 emptyI; // lmao void EMPTY(s16 i){emptyI = i;} - -// structs - -struct bulletSpawner { - fix16 x, y, speed; - Vect2D_f16 vel; - s16 angle; - SpriteDefinition* image; - bool big, player; - bool bools[COUNT_INT]; - s16 ints[COUNT_INT]; - fix16 fixes[COUNT_INT]; -}; - void collideObstacleWithPlayer(s16); - -struct playerStruct { - Vect2D_f16 pos, vel; - Sprite* image; - s16 clock, invincibleClock, shotClock; -}; -struct playerStruct player; \ No newline at end of file diff --git a/src/main.c b/src/main.c index c6e6079..cc1e75d 100644 --- a/src/main.c +++ b/src/main.c @@ -4,6 +4,7 @@ #include #include "global.h" +#include "structs.h" #include "controls.h" #include "background.h" #include "foreground.h" diff --git a/src/structs.h b/src/structs.h new file mode 100644 index 0000000..4235cbc --- /dev/null +++ b/src/structs.h @@ -0,0 +1,34 @@ +// structs + +#define BULLET_COUNT 64 +struct bulletSpawner { + fix16 x, y, speed; + Vect2D_f16 vel; + s16 angle; + SpriteDefinition* image; + bool big, player; + bool bools[COUNT_INT]; + s16 ints[COUNT_INT]; + fix16 fixes[COUNT_INT]; +}; +struct bullet { + bool active, player; + fix16 speed; + fix32 dist; + Vect2D_f16 pos, vel; + s16 angle, clock; + Sprite* image; + bool dead, big; + void (*updater)(s16); + bool bools[COUNT_INT]; + s16 ints[COUNT_INT]; + fix16 fixes[COUNT_INT]; +}; +struct bullet bullets[BULLET_COUNT]; + +struct playerStruct { + Vect2D_f16 pos, vel; + Sprite* image; + s16 clock, invincibleClock, shotClock; +}; +struct playerStruct player;