This is the doxygen documentation for gtkboard.
.
#include <game.h>
Data Fields | |
int | cell_size |
The size of each square on the board in pixels. | |
int | board_wid |
The number of rows in the board. | |
int | board_heit |
The number of columns in the board. | |
int | num_pieces |
The number of types of pieces that the game uses. More... | |
char* | colors |
An array which gives the colors for the squares of the board. | |
int* | init_pos |
The initial position. | |
char*** | pixmaps |
An array of pixmaps representing the pieces. | |
char* | name |
void (* | game_init )() |
A pointer to the function that will be called when initializing the game. |
Only information that must be provided by every game is declared here. Of course, there are many other variables and functions that can be used to customize the game. These must be set in the function game_init. The good thing is that you can get your game running first and only use new features as you need them.
Definition at line 156 of file game.h.
|
The number of columns in the board.
|
|
The number of rows in the board.
|
|
The size of each square on the board in pixels.
|
|
An array which gives the colors for the squares of the board.
|
|
A pointer to the function that will be called when initializing the game.
Referenced by engine_new_game(), parse_opts(), and ui_start_game(). |
|
The initial position.
|
|
|
|
The number of types of pieces that the game uses. (12 for chess (chess.c), for instance -- 6 white and 6 black). The maximum value is 127. In several games, like mastermind (mastermind.c), the value of num_pieces is more than the actual number of pieces that the user sees. This is because several logical pieces are mapped to the same image and the value of the piece is used to encode some state information about that square. |
|
An array of pixmaps representing the pieces.
|