7#ifndef BRICK_GAME_V1_0_BRICK_GAME_TETRIS_GAME_H_
8#define BRICK_GAME_V1_0_BRICK_GAME_TETRIS_GAME_H_
174void update_game_data(
GameData *game_data);
192int get_level(
const GameData *game_data);
Defines the playfield and operations on it.
GameState
Enumeration of all states of the game's Finite State Machine.
Definition game.h:19
@ START
Start screen of the game.
Definition game.h:24
@ MOVING
Main state of the game, the player is in control of the piece.
Definition game.h:59
@ CLEARING
Full lines are cleared and points are awarded.
Definition game.h:85
@ ATTACHING
The played piece is attached to the field.
Definition game.h:67
@ GAME_OVER
Game over screen of the game.
Definition game.h:91
@ SPAWN
Spawn the next piece and generate a new random next piece.
Definition game.h:48
@ SPAWN_START
Spawn a random first piece and generate a random next piece.
Definition game.h:35
Defines pieces and operations on them.
PieceType
Possible piece types.
Definition piece.h:23
A list of indices of lines that are detected to be full.
Definition game.h:108
int len
Length of the initialized portions of the lines array.
Definition game.h:112
A structure containing all data about the current game session.
Definition game.h:116
bool top_score_loaded
Indicates if the top_score has been loaded from the file yet.
Definition game.h:165
int top_score
Current highscore.
Definition game.h:154
FilledLines filled_lines
Information about cleared lines.
Definition game.h:134
Inputs inputs
Inputs that are being pressed this frame.
Definition game.h:157
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
int score
Current score.
Definition game.h:149
PlayField field
Current Playfield.
Definition game.h:123
PieceType next_piece
The type of the next piece to spawn.
Definition game.h:129
int timer
Counter used for timing different things.
Definition game.h:141
int piece_land_y
The y position of the last attached piece.
Definition game.h:146
bool paused
Indicates if the game is currently paused.
Definition game.h:160
State of the playfield.
Definition field.h:17
State of the currently played piece.
Definition piece.h:34