本文实例为大家分享了C++俄罗斯方块游戏的具体实现代码,供大家参考,具体内容如下、
#include#include #include #include #include #define MOD 28 #define SIZE_N 19 #define SIZE_M 12 int cur_x,cur_y; int score,mark,next,map[SIZE_N][SIZE_M],Gamespeed=300; 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 gotoxy(int x,int y){ COORD c; c.X=x-1; c.Y=y-1; SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c); } void Gameover(){ int i,j,flag=0; for(j=1;j 1;ii--){ for(jj=1;jj 关于C++小游戏的更多精彩内容请点击专题: 《C++经典小游戏》 学习了解
以上就是本文的全部内容,希望对大家学习C++程序设计有所帮助。



