About Tetris Game software C language initial experience

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.