diff --git a/main.c b/main.c index d417970..34a7d94 100644 --- a/main.c +++ b/main.c @@ -4,17 +4,17 @@ #include #include #include -#define SCREEN_WIDTH 11 -#define SCREEN_HEIGHT 20 -#define PADDLE_SIZE 2 -#define SLEEP_TIME_MS 100 * 1000 -#define PADDLE_HEIGHT SCREEN_HEIGHT-4 -#define Y_BLOCK_LAYERS 10 +#define SCREEN_WIDTH 11 //set the width of the game screen +#define SCREEN_HEIGHT 20 //set the height of the game screen +#define PADDLE_SIZE 2 //set the paddle size. the blocks are added this amount either size of a central block. +#define SLEEP_TIME_MS 100 * 1000 //set the time to sleep between frames +#define PADDLE_HEIGHT SCREEN_HEIGHT-4 //the negative number is distance from the bottom +#define Y_BLOCK_LAYERS 10 //add the amount of layers of blocks from the top of the screen #define X_BLOCK_LAYERS SCREEN_WIDTH -uint8_t screen[SCREEN_WIDTH][SCREEN_HEIGHT]; +uint8_t screen[SCREEN_WIDTH][SCREEN_HEIGHT]; //this is the array the game lives in -enum PIXEL_TYPE { +enum PIXEL_TYPE { //used to set what kind of pixel is shown on the screen array PIXEL_EMPTY=0u, PIXEL_BALL=1u, PIXEL_BLOCK=2u, @@ -23,7 +23,7 @@ enum PIXEL_TYPE { PIXEL_PADDLE_RIGHT=5u } PIXEL_TYPE; -void clearScreen() { +void clearScreen() { //clears the screen of all pixels to redraw the screen for (int y = 0; y < SCREEN_HEIGHT; y++) { for (int x=0; x