This commit is contained in:
t. boddy 2026-02-14 20:36:23 -05:00
parent 0b905f2690
commit e8ed3e0faf
6 changed files with 25 additions and 52 deletions

View file

@ -1,6 +1,5 @@
u32 clock;
#define CLOCK_LIMIT 32000
#define COUNT_INT 4
#define GAME_H_F FIX32(224)
@ -9,24 +8,15 @@ u32 clock;
#define SECTION_COUNT 4 // Number of sections (N = 2, 4, 8, etc.)
#define GAME_WRAP (SECTION_SIZE * SECTION_COUNT) // Total world width
u32 score, highScore;
u32 score;
#define SCORE_LENGTH 8
#define FIRST_ROTATING_BULLET 3
#define CAMERA_Y_MOD FIX32(112)
// Screen bounds for visibility (screen is 320x224)
// VDP wraps sprites every 512px, so we must hide sprites outside screen
#define VISIBLE_X_MIN 0
#define VISIBLE_X_MAX 512
#define VISIBLE_Y_MIN -32
#define VISIBLE_Y_MAX 256
char debugStr[8];
s16 emptyI;
void EMPTY(s16 i){emptyI = i;}
void EMPTY(s16 i){(void)i;}
bool gameOver, paused, started;
bool gameOver;
s16 enemyCount;
// controls
@ -35,7 +25,7 @@ struct controls {
};
struct controls ctrl;
void updateControls(u16 joy, u16 changed, u16 state){
if(changed){}
(void)changed; // Unused parameter
if(joy == JOY_1){
ctrl.left = (state & BUTTON_LEFT);
ctrl.right = (state & BUTTON_RIGHT);
@ -51,7 +41,7 @@ void updateControls(u16 joy, u16 changed, u16 state){
// player
struct playerStruct {
Vect2D_f32 pos, vel, last;
Vect2D_f32 pos, vel;
s16 shotAngle;
u8 lives;
fix32 camera;
@ -68,21 +58,14 @@ struct bulletSpawner {
Vect2D_f32 vel;
s16 angle, anim;
bool top, player;
bool bools[COUNT_INT];
s16 ints[COUNT_INT];
fix32 fixes[COUNT_INT];
};
struct bullet {
bool active, player, explosion, top, vFlip, hFlip;
fix32 speed;
bool active, player, vFlip, hFlip;
Vect2D_f32 pos, vel;
Sprite* image;
s16 clock, angle, anim, frame;
s16 dist;
void (*updater)(s16);
bool bools[COUNT_INT];
s16 ints[COUNT_INT];
fix32 fixes[COUNT_INT];
};
struct bullet bullets[BULLET_COUNT];
@ -92,16 +75,11 @@ struct bullet bullets[BULLET_COUNT];
struct enemy {
bool active;
s16 clock, angle, anim, frame, off;
fix32 speed;
u8 type;
s16 angle, off;
fix32 speed;
Vect2D_f32 vel, pos;
s16 dist;
Sprite* image;
void (*updater)(s16);
bool bools[COUNT_INT];
s16 ints[COUNT_INT];
fix32 fixes[COUNT_INT];
};
struct enemy enemies[ENEMY_COUNT];