#ifndef TETRIS_H #define TETRIS_H // GAME SETTINGS static int fps = 60; static int font_size = 10; static int score = 0; #define TETROMINO_SIZE_HEIGHT 2 #define TETROMINO_SIZE_WIDTH 4 static Color I = (Color){0, 255, 255, 255}; static Color O = (Color){255, 255, 102, 255} ; static Color T = (Color){138, 43, 226, 255}; static Color S = (Color){34, 139, 34, 255} ; static Color Z = (Color){255, 69, 0, 255}; static Color J = (Color){70, 130, 180, 255}; static Color L = (Color){255, 140, 0, 255}; // Settigs static int window_width = 400; static int window_height = 600 static int columns = 10; static int rows = 20; static int cell_width = window_width / columns; static int cell_height = window_height / row; typedef struct TETROMINO TETROMINO; struct TETROMINO { int x; int y; Color color; int blocks[TETROMINO_SIZE_HEIGHT][TETROMINO_SIZE_WIDTH]; }; static TETROMINO TETROMINOES[7] = { // Making the tetrominoes in an array design {{ {0, 0, 0, 0}, {1, 1, 1, 1}, }, CYAN_I, COLUMNS / 2, 0}, // supposed to have 2 forms of rotations // default spawn location is: center {{ {0, 1, 1, 0}, {0, 1, 1, 0}, }, YELLOW_O, COLUMNS / 2, 0}, // supposed to have no rotation forms // default spawn location is: center {{ {0, 1, 0, 0}, {1, 1, 1, 0}, }, PURPLE_T, 0, 0}, // flat side left center // 4 rotational forms {{ {0, 1, 1, 0}, {1, 1, 0, 0}, }, GREEN_S, 0, 0}, // left center // 4 rotational forms {{ {1, 1, 0, 0}, {0, 1, 1, 0}, }, RED_Z, 0, 0}, // left center // 4 rotational forms {{ {1, 0, 0, 0}, {1, 1, 1, 0}, }, BLUE_J, 0, 0}, // flat side first and left center // 4 rotational forms {{ {0, 0, 1, 0}, {1, 1, 1, 0}, }, ORANGE_L, 0, 0}, // flat side first and left center // 4 rotational forms }; #endif