#include #include "lib2d.h" #define TILE_TIM 0x80092CE0 #define BALL_TIM 0x80092930 #define MAX_BRICKS (100) #define MAX_BALLS (100) #define BRICK_PRIORITY (100) #define BALL_PRIORITY (30) // directions #define NE (0) #define NW (1) #define SE (2) #define SW (3) #define N (4) // STRUCTURES //------------ // Generic brick structure. typedef struct { u_long state; // state varible (UNUSED) ? GsSPRITE sprite; RECT left; // Has four bounding boxes so RECT right; // that it is possible to find RECT bottom; // out exactly where the collision RECT top; // occurs. } BRICK; // Generic ball structure. typedef struct { GsSPRITE sprite; long sizeMod; // size modifier used to adjust collision box u_long size; // size of ball (1-4) long vx,vy; // its velocity RECT box; // bounding box used for collisions } BALL; // PROTOTYPES //------------ void SetBoxInfo(RECT *rect, long x, long y, long w, long h); void SetupLevel(u_long level); void AddBrick(long x, long y); void SetupBricksBlank(); void DrawBricks(); void UpdateBalls(); void DrawBalls(); long SplitBall(long index); long RemoveBall(long index); void AddBall(long x, long y, long size, u_long direction); long CollisionLeft(RECT rect); long CollisionRight(RECT rect); long CollisionBottom(RECT rect); long CollisionTop(RECT rect); long CollisionBalls(RECT rect); // GLOBALS //--------- BRICK bricks[MAX_BRICKS]; // Array of bricks long bricksInGame; // how many bricks are present in the game. BALL balls[MAX_BALLS]; // Array of all the balls. long ballsInGame; // a counter to keep track on amount of balls