4#ifndef BRICK_GAME_V1_0_BRICK_GAME_TETRIS_GAME_COMMON_H_
5#define BRICK_GAME_V1_0_BRICK_GAME_TETRIS_GAME_COMMON_H_
13 return rand() % PIECE_TYPE_COUNT;
22 game_data->
state = new_state;
static PieceType generate_piece(void)
Generate a random piece type.
Definition common.h:12
GameState
Enumeration of all states of the game's Finite State Machine.
Definition game.h:19
PieceType
Possible piece types.
Definition piece.h:23
A structure containing all data about the current game session.
Definition game.h:116
static void reset_game_data(GameData *game_data)
Reset game state between play sessions.
Definition common.h:31
int top_score
Current highscore.
Definition game.h:154
GameState state
Current state of the game's state machine.
Definition game.h:118
PlayedPiece played_piece
Information about the currently played piece.
Definition game.h:126
static void transition_state(GameData *game_data, GameState new_state)
Transition the current game state to the given one.
Definition common.h:21
int timer
Counter used for timing different things.
Definition game.h:141
int x
X offset of the upper left corner of the piece data.
Definition piece.h:36
int y
Y offset of the upper left corner of the piece data.
Definition piece.h:38