This commit is contained in:
t. boddy 2022-08-16 22:54:50 -04:00
parent 2bd8fa1aa9
commit 9102b190c8
4 changed files with 35 additions and 41 deletions

View File

@ -1,25 +1,5 @@
// bullets // 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 4
#define BULLET_OFF_BIG 8 #define BULLET_OFF_BIG 8

View File

@ -26,25 +26,4 @@ u32 score,
s16 emptyI; // lmao s16 emptyI; // lmao
void EMPTY(s16 i){emptyI = i;} 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); void collideObstacleWithPlayer(s16);
struct playerStruct {
Vect2D_f16 pos, vel;
Sprite* image;
s16 clock, invincibleClock, shotClock;
};
struct playerStruct player;

View File

@ -4,6 +4,7 @@
#include <resources.h> #include <resources.h>
#include "global.h" #include "global.h"
#include "structs.h"
#include "controls.h" #include "controls.h"
#include "background.h" #include "background.h"
#include "foreground.h" #include "foreground.h"

34
src/structs.h Normal file
View File

@ -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;