mostly squash compiler warnings

This commit is contained in:
t. boddy 2022-08-16 22:52:26 -04:00
parent 8646b6c1a0
commit 2bd8fa1aa9
6 changed files with 27 additions and 23 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

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

View File

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

View File

@ -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,7 +33,7 @@ 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];
@ -39,3 +41,10 @@ struct bulletSpawner {
};
void collideObstacleWithPlayer(s16);
struct playerStruct {
Vect2D_f16 pos, vel;
Sprite* image;
s16 clock, invincibleClock, shotClock;
};
struct playerStruct player;

View File

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

View File

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