C Language course set, the teacher first sent us a use of C language aircraft game, the first time to see the C language to do the game, although the picture is simple, but it is the real game. After the teacher sent us a C language to do Tetris game
int x; X-axis coordinates of the center block
int y; Y-axis coordinates of the center block
int flag; Mark the ordinal of a block type
int next; Ordinal of the next Russian block type
int speed; The speed at which Tetris moves
int count; Number of Tetris generated
int score; Score of the game
int level; The level of the game
With these statements, you can represent the data used by the game.
Make a game window
void Make_frame ();
Random number of block types generated
void Get_flag (struct Tetris *);
Making Tetris
void Make_tetris (struct Tetris *);
Print Tetris
void Print_tetris (HANDLE hout,struct Tetris *);
Clear the traces of Tetris
void Clear_tetris (HANDLE hout,struct Tetris *);
Determine if it can be moved, the return value is 1, can move, otherwise, do not move
int if_moveable (struct Tetris *);
Determine if the row is full and delete the full row of Tetris
These statements will allow you to plan the basic rules of Tetris. Through the various statements, you can make the Tetris, and we usually use C language to do some of the judgment tools are very different, because you can skillfully use the statement, in order to perfect the expression. A simple Tetris with a large number of logical statements, which also tells us that the use of C language is not skilled enough, so we should strengthen the use of C language statements, so that we more skilled use of C language, to make the correct program.
About Tetris Game software C language initial experience