diff --git a/res/bg/wall1.png b/res/bg/wall1.png index a61d2c2..4570268 100644 Binary files a/res/bg/wall1.png and b/res/bg/wall1.png differ diff --git a/src/chrome.h b/src/chrome.h index f436817..ed33640 100644 --- a/src/chrome.h +++ b/src/chrome.h @@ -26,14 +26,14 @@ static void loadScore(){ VDP_drawText(scoreStr, SCORE_X, SCORE_Y); } -static void updateScore(){ - if(lastScore != score){ - intToStr(score, scoreStr, SCORE_LENGTH); - VDP_drawText(scoreStr, SCORE_X, SCORE_Y); - lastScore = score; - } - score++; -} +// static void updateScore(){ +// if(lastScore != score){ +// intToStr(score, scoreStr, SCORE_LENGTH); +// VDP_drawText(scoreStr, SCORE_X, SCORE_Y); +// lastScore = score; +// } +// score++; +// } // zone diff --git a/src/foreground.h b/src/foreground.h index 691232b..95b68b4 100644 --- a/src/foreground.h +++ b/src/foreground.h @@ -35,7 +35,7 @@ static void drawFg(){ #define OBS_FLOOR_Y 20 #define OBS_X 32 -#define OBS_TOP_Y FIX16(24) +#define OBS_TOP_Y FIX16(56) #define OBS_BOTTOM_Y FIX16(160) s16 fgPos; diff --git a/src/global.h b/src/global.h index cbb6bd9..8c74bf3 100644 --- a/src/global.h +++ b/src/global.h @@ -14,6 +14,7 @@ #define CLOCK_LIMIT 32000 #define COUNT_INT 8 +#define INVINCIBLE_LIMIT 60 * 4 bool killBullets; @@ -22,7 +23,8 @@ s16 clock; u32 score, highScore; -void EMPTY(s16 i){} +s16 emptyI; // lmao +void EMPTY(s16 i){emptyI = i;} // structs @@ -31,11 +33,18 @@ struct bulletSpawner { fix16 x, y, speed; Vect2D_f16 vel; s16 angle; - Sprite* image; + SpriteDefinition* image; bool big, player; bool bools[COUNT_INT]; s16 ints[COUNT_INT]; fix16 fixes[COUNT_INT]; }; -void collideObstacleWithPlayer(s16); \ No newline at end of file +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 947010c..c6e6079 100644 --- a/src/main.c +++ b/src/main.c @@ -7,8 +7,8 @@ #include "controls.h" #include "background.h" #include "foreground.h" -#include "player.h" #include "bullets.h" +#include "player.h" #include "chrome.h" // game loop diff --git a/src/player.h b/src/player.h index a44ee07..c513fb6 100644 --- a/src/player.h +++ b/src/player.h @@ -4,16 +4,8 @@ #define PLAYER_INIT_X FIX16(32) #define PLAYER_INIT_Y FIX16(124) -#define INVINCIBLE_LIMIT 60 * 4 #define SHOT_INTERVAL 15 -struct playerStruct { - Vect2D_f16 pos, vel; - Sprite* image; - s16 clock, invincibleClock, shotClock; -}; -struct playerStruct player; - // spawn @@ -48,10 +40,13 @@ static void checkPlayerBounds(){ } void collideObstacleWithPlayer(s16 i){ - if(obstacles[i].pos.x < fix16Add(player.pos.x, PLAYER_OFF) && + if( + obstacles[i].pos.x < fix16Add(player.pos.x, PLAYER_OFF) && fix16Add(obstacles[i].pos.x, obstacles[i].size.x) > fix16Sub(player.pos.x, PLAYER_OFF) && obstacles[i].pos.y < fix16Add(player.pos.y, PLAYER_OFF) && - fix16Add(obstacles[i].pos.y, obstacles[i].size.y) > fix16Sub(player.pos.y, PLAYER_OFF)){ + fix16Add(obstacles[i].pos.y, obstacles[i].size.y) > fix16Sub(player.pos.y, PLAYER_OFF) + + ){ if(obstacles[i].pos.x > player.pos.x) player.pos.x = fix16Sub(fix16Sub(obstacles[i].pos.x, FG_SPEED), PLAYER_OFF); else if(obstacles[i].pos.y > player.pos.y) player.pos.y = fix16Sub(obstacles[i].pos.y, PLAYER_OFF); checkPlayerBounds();