shit lmao

This commit is contained in:
t. boddy 2026-02-18 22:05:46 -05:00
parent 06e8e735fb
commit 6adbe1882d
40 changed files with 608 additions and 361 deletions

View file

@ -8,6 +8,8 @@ void sfxPickup();
void loadMap();
void loadGame();
#define SKIP_START 1
u32 clock;
#define CLOCK_LIMIT 32000
#define PROP_COUNT 8
@ -20,8 +22,8 @@ u32 clock;
#define CULL_LIMIT FIX32(240)
// #define MUSIC_VOLUME 50
#define MUSIC_VOLUME 0
#define MUSIC_VOLUME 50
// #define MUSIC_VOLUME 0
u32 score;
#define SCORE_LENGTH 8
@ -43,8 +45,14 @@ u8 level;
s16 pendingBossHp;
s16 pendingBossNum;
bool waitForRelease;
s16 treasureCollectedClock;
u8 treasureCollectedType;
bool allTreasureCollected;
u8 hitMessageClock;
bool hitMessageBullet; // TRUE = blasted, FALSE = smashed
bool levelClearing;
u32 levelClearClock;
u8 levelWaitClock;
// controls
struct controls {
@ -70,7 +78,7 @@ void updateControls(u16 joy, u16 changed, u16 state){
struct playerStruct {
Vect2D_f32 pos, vel;
s16 shotAngle;
u8 lives, recoveringClock;
u8 lives, recoveringClock, respawnClock;
fix32 camera;
Sprite* image;
};
@ -121,32 +129,33 @@ struct enemy {
};
struct enemy enemies[ENEMY_COUNT];
// humans
#define HUMAN_COUNT 8
#define HUMAN_WALKING 0
#define HUMAN_CARRIED 1
#define HUMAN_FALLING 2
#define HUMAN_COLLECTED 3
// treasure
#define TREASURE_COUNT 8
#define TREASURE_WALKING 0
#define TREASURE_CARRIED 1
#define TREASURE_FALLING 2
#define TREASURE_COLLECTED 3
struct human {
struct treasure {
bool active;
u8 state;
u8 type;
s16 carriedBy;
s16 trailIndex;
Vect2D_f32 pos, vel;
Sprite* image;
};
struct human humans[HUMAN_COUNT];
bool humanBeingCarried;
struct treasure treasures[TREASURE_COUNT];
bool treasureBeingCarried;
s16 collectedCount;
void killHuman(u8 i){
if(humans[i].state == HUMAN_CARRIED && humans[i].carriedBy >= 0){
enemies[humans[i].carriedBy].ints[3] = -1;
humanBeingCarried = FALSE;
void killTreasure(u8 i){
if(treasures[i].state == TREASURE_CARRIED && treasures[i].carriedBy >= 0){
enemies[treasures[i].carriedBy].ints[3] = -1;
treasureBeingCarried = FALSE;
}
humans[i].active = FALSE;
SPR_releaseSprite(humans[i].image);
treasures[i].active = FALSE;
SPR_releaseSprite(treasures[i].image);
}
void killBullet(u8 i, bool explode){
@ -181,13 +190,13 @@ void killEnemy(u8 i){
if(enemies[i].hp > 0) return;
if(enemies[i].ints[3] >= 0){
s16 h = enemies[i].ints[3];
if(humans[h].active){
humans[h].state = HUMAN_FALLING;
humans[h].carriedBy = -1;
humans[h].vel.x = 0;
humans[h].vel.y = FIX32(3);
if(treasures[h].active){
treasures[h].state = TREASURE_FALLING;
treasures[h].carriedBy = -1;
treasures[h].vel.x = 0;
treasures[h].vel.y = FIX32(3);
}
humanBeingCarried = FALSE;
treasureBeingCarried = FALSE;
}
enemies[i].active = FALSE;
SPR_releaseSprite(enemies[i].image);