#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 now); void PrintPrompting(); void YourScore(); void GotoxyWithFullwidth(short x, short y);//全角 void Gameover(); void ShowMap(int now); void GotoxyWithFullwidth(short x, short y)//【全角定位】 { static COORD cd;//坐标定义 cd.X = x; 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(50, 5); printf("□向左移动: ←"); GotoxyWithFullwidth(50, 6); printf("□向右移动: →"); GotoxyWithFullwidth(50, 7); printf("□向下移动: ↓"); GotoxyWithFullwidth(50, 8); printf("□顺时针转: ↑"); GotoxyWithFullwidth(50, 9); printf("□空格让悬停方块倒回"); GotoxyWithFullwidth(50, 14); printf("|嘻嘻,欢迎来到 俄罗斯方块吃柠檬世界 ") ; GotoxyWithFullwidth(50,15); printf("|我以被课设逼疯的作者君之名命令你"); GotoxyWithFullwidth(50, 16); printf("|变成世界上最可爱的妹子!!!") ; GotoxyWithFullwidth(50, 17); printf("|(呜呜呜人家才不是凑行数的老嘤比)"); GotoxyWithFullwidth(50, 18); printf("|继续你的游戏叭~~啾咪~~~(喂喂,这一行水得也太明显了叭!)"); GotoxyWithFullwidth(75, 28); printf("★By: 呜呜呜这是一只躲在角落没有名字的小菜鸡"); } void Gameover()//【判断游戏是否结束】 { int i,j,flag=0; for(j=1;j1;p--) { for( q=1;q