Go to the documentation of this file.
36 #define INIT_COORDS_X COLS/2 -1
37 #define INIT_COORDS_Y 0
44 #define LEFT_PRESSED 1
45 #define RIGHT_PRESSED 2
46 #define DOWN_PRESSED 3
#define FIGURE_SIZE
Maximum length/width of a Tetromino.
Definition: tetrisConfig.h:78
enum tetromino_type tetromino_type_t
Tetromino types.
uint8_t level
The current level.
Definition: logic.h:73
void vLogicRotate(tetromino_t *tetromino, const color_t landed[ROWS][COLS], rotation_t rotationMode)
Rotate tetromino, if possible.
Definition: logic.c:181
color_t shape[FIGURE_SIZE][FIGURE_SIZE]
Array containing the Tetrominos shape.
Definition: logic.h:61
bool vLogicRowFull(color_t landed[ROWS][COLS], score_t *score)
Check how many rows are full and remove them.
Definition: logic.c:221
#define ROWS
Number of rows, that the board contains.
Definition: tetrisConfig.h:80
enum color color_t
Tetromino colors.
File containing some game configurations.
tetromino_type_t type
Tetromino type.
Definition: logic.h:56
#define COLS
Number of columns, that the board contains.
Definition: tetrisConfig.h:79
color_t color
Tetrominos color.
Definition: logic.h:58
enum rotation rotation_t
Rotations.
void vLogicAddToLanded(const tetromino_t *tetromino, color_t landed[ROWS][COLS])
Add tetromino to the landed array.
Definition: logic.c:207
color_t newShape[FIGURE_SIZE][FIGURE_SIZE]
Array to check a potential shape.
Definition: logic.h:63
Structure representing a Tetromino.
Definition: logic.h:52
Structure for the score.
Definition: logic.h:70
char * userName
The selected User-Name.
Definition: logic.h:75
bool bLogicCheckGameOver(const tetromino_t *tetromino, const color_t landed[ROWS][COLS])
Check if the game will be over if the new tetromino is created.
Definition: logic.c:136
struct score score_t
Structure for the score.
uint32_t score
The current score.
Definition: logic.h:72
Holds a pixel co-ordinate.
Definition: TUM_Draw.h:121
coord_t newPosition
New position to check.
Definition: logic.h:55
uint16_t rows
Number of rows cleared.
Definition: logic.h:74
struct tetromino tetromino_t
Structure representing a Tetromino.
bool bLogicCheckMove(const color_t newShape[FIGURE_SIZE][FIGURE_SIZE], coord_t newPosition, const color_t landed[ROWS][COLS])
Check if a move to a newPosition is possible.
Definition: logic.c:108
coord_t position
Position of top left square.
Definition: logic.h:54
bool bLogicUpdateYCoord(tetromino_t *tetromino, const color_t landed[ROWS][COLS])
Update the y coordinate of tetromino.
Definition: logic.c:165
void vLogicUpdateXCoord(tetromino_t *tetromino, const color_t landed[ROWS][COLS], int pressedButton)
Update the x coordinate of tetromino.
Definition: logic.c:143
enum player_mode player_mode_t
Player modes.
int rotation
Tetrominos rotation.
Definition: logic.h:57
void vLogicInitTetromino(tetromino_t *tetromino, tetromino_type_t types[], int *index, player_mode_t playerMode)
Initialize a Tetromino.
Definition: logic.c:45