#include #include #include #include #include #include #define N 20 #define M 16 int cur_x,cur_y; int score,mark,next,map[N][M],Gamespeed=400; int shape[28][6]= { {0,-1,0,-2,1,0}, {0,1,1,0,2,0}, {-1,0,0,1,0,2}, {0,-1,-1,0,-2,0}, {0,-1,0,1,-1,0}, {0,1,1,0,-1,0}, {1,0,0,-1,0,1}, {1,0,-1,0,0,-1}, {-1,1,0,1,1,0}, {0,-1,1,0,1,1}, {-1,0,0,-1,1,-1}, {-1,-1,-1,0,0,1}, {-1,0,0,1,1,1}, {0,1,1,-1,1,0}, {-1,0,0,1,1,1}, {0,1,1,-1,1,0}, {-1,0,0,-1,0,-2}, {-1,0,-2,0,0,1}, {0,1,0,2,1,0}, {0,-1,1,0,2,0}, {0,1,1,0,1,1}, {0,-1,1,0,1,-1}, {-1,0,0,-1,-1,-1}, {-1,0,-1,1,0,1}, {0,1,0,2,0,3}, {1,0,2,0,3,0}, {0,-1,0,-2,0,-3}, {-1,0,-2,0,-3,0} }; void Init(int id); void PrintPrompting();//显示提示信息 void YourScore(); void GotoxyWithFullwidth(short x, short y);//全角 void Gameover(); void ShowMap(int id); void GotoxyWithFullwidth(short x, short y)//【全角定位】 { static COORD cd;//坐标定义 cd.X = (short)(x << 1);//左移 cd.Y = y; HANDLE A_GConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorPosition(A_GConsoleOutput, cd); } void PrintPrompting()//【显示提示信息 】 { HANDLE A_GConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(A_GConsoleOutput, 0xF); GotoxyWithFullwidth(25, 12); printf("□向左移动: ←"); GotoxyWithFullwidth(25, 13); printf("□向右移动: →"); GotoxyWithFullwidth(25, 14); printf("□向下移动: ↓"); GotoxyWithFullwidth(25, 15); printf("□顺时针转: ↑"); GotoxyWithFullwidth(25, 16); printf("□空格让悬停方块倒回"); GotoxyWithFullwidth(35, 12); printf("|嘻嘻,欢迎来到 俄罗斯方块吃柠檬世界 ") ; GotoxyWithFullwidth(35,13); printf("|我以被课设逼疯的作者君之名命令你"); GotoxyWithFullwidth(35, 14); printf("|变成世界上最可爱的妹子!!!") ; GotoxyWithFullwidth(35, 15); printf("|(呜呜呜人家才不是凑行数的老嘤比)"); GotoxyWithFullwidth(35, 16); printf("|继续你的游戏叭~~啾咪~~~(喂喂,这一行也太明显了叭!)"); GotoxyWithFullwidth(36, 30); printf("★By: 呜呜呜这是一只躲在角落没有名字的小菜鸡"); } void Gameover() {//游戏结束的判断 CONSOLE_CURSOR_INFO cursorInfo = { 1, FALSE}; int i,j,flag=0; for(j=1;j1;ii-- ){ for( jj=1;jj