资源简介
代码片段和文件信息
#include
#include
#include
#include
#include
#include
using namespace std;
int block00[4][4] = { { 10000 }{ 1111 }{ 0000 }{ 0000 } };
int block01[4][4] = { { 11010 }{ 0010 }{ 0010 }{ 0010 } };
int block02[4][4] = { { 12000 }{ 0000 }{ 1110 }{ 0100 } };
int block03[4][4] = { { 13000 }{ 0100 }{ 1100 }{ 0100 } };
int block04[4][4] = { { 14000 }{ 0000 }{ 0100 }{ 1110 } };
int block05[4][4] = { { 15000 }{ 0100 }{ 0110 }{ 0100 } };
int block06[4][4] = { { 16000 }{ 0000 }{ 1110 }{ 1000 } };
int block07[4][4] = { { 17000 }{ 1100 }{ 0100 }{ 0100 } };
int block08[4][4] = { { 18000 }{ 0000 }{ 0010 }{ 1110 } };
int block09[4][4] = { { 19000 }{ 0100 }{ 0100 }{ 0110 } };
int block10[4][4] = { { 20000 }{ 0000 }{ 1110 }{ 0010 } };
int block11[4][4] = { { 21000 }{ 0100 }{ 0100 }{ 1100 } };
int block12[4][4] = { { 22000 }{ 0000 }{ 1000 }{ 1110 } };
int block13[4][4] = { { 23000 }{ 0110 }{ 0100 }{ 0100 } };
int block14[4][4] = { { 24000 }{ 0000 }{ 0110 }{ 1100 } };
int block15[4][4] = { { 25000 }{ 1000 }{ 1100 }{ 0100 } };
int block16[4][4] = { { 26000 }{ 0000 }{ 1100 }{ 0110 } };
int block17[4][4] = { { 27000 }{ 0010 }{ 0110 }{ 0100 } };
int block18[4][4] = { { 28000 }{ 0000 }{ 1100 }{ 1100 } };
void initialWindow(HANDLE hOut);//初始化窗口
void initialPrint(HANDLE hOut);//初始化界面
void gotoXY(HANDLE hOut int x int y);//移动光标
void roundBlock(HANDLE hOut int block[4][4]);//随机生成方块并打印到下一个方块位置
bool collisionDetection(int block[4][4] int map[21][12] int x int y);//检测碰撞
void printBlock(HANDLE hOut int block[4][4] int x int y);//打印方块
void clearBlock(HANDLE hOut int block[4][4] int x int y);//消除方块
void myLeft(HANDLE hOut int block[4][4] int map[21][12] int x int &y);//左移
void myRight(HANDLE hOut int block[4][4] int map[21][12] int x int &y);//右移
void myUp(HANDLE hOut int block[4][4] int map[21][12] int x int &y);//顺时针旋转90度
int myDown(HANDLE hOut int block[4][4] int map[21][12] int &x int y);//加速下落
void myStop(HANDLE hOut int block[4][4]);//游戏暂停
void gameOver(HANDLE hOut int block[4][4] int map[21][12]);//游戏结束
void eliminateRow(HANDLE hOut int map[21][12] int &val int &fraction int &checkpoint);//判断是否能消行并更新分值
int main()
{
int map[21][12];
int blockA[4][4];//候选区的方块
int blockB[4][4];//下落中的方块
int positionX positionY;//方块左上角的坐标
bool check;//检查方块还能不能下落
char key;//用来存储按键
int val;//用来控制下落速度
int fraction;//用来存储得分
int checkpoint;//用来存储关卡
int times;
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);//获取标准输出设备句柄
initialWindow(hOut);
initial:
gotoXY(hOut 0 0);
initialPrint(hOut);
check = true;
val
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 36325 2020-12-29 12:39 俄罗斯方块\俄罗斯方块.cpp
文件 29485 2020-12-29 12:40 俄罗斯方块\俄罗斯方块.o
文件 82326 2020-12-29 12:40 俄罗斯方块\俄罗斯方块.exe
目录 0 2020-12-27 16:12 俄罗斯方块
----------- --------- ---------- ----- ----
148136 4
- 上一篇:跑跑卡丁车.cpp
- 下一篇:五子棋c++控制台代码
相关资源
- opencv版俄罗斯方块源码
- 俄罗斯方块源码用VC开发
- C语言版俄罗斯方块基于EASYX库
- VC++ Win32俄罗斯方块游戏源码(新)
- C++图形系统实现俄罗斯方块小游戏
- c++ 俄罗斯方块( + 文档)
- 用C++使用SDL库编写的俄罗斯方块游戏
- VC++MFC小游戏开发教程+扫雷+五子棋+俄
- 一个控制台俄罗斯方块C++源代码及可
- 基于MFC的俄罗斯方块游戏
- 俄罗斯方块游戏exe程序和所有代码资
- 功能完善的俄罗斯方块程序(C语言编
- MFC俄罗斯方块源码
- 俄罗斯方块C语言实现,用到了C语言的
- 基于MFC的VC++俄罗斯方块程序源代码
- 自己用C语言写的俄罗斯方块游戏——
- STM32实现俄罗斯方块游戏C语言
- 手把手教你用vc6 c++ 做俄罗斯方块小游
- MFC 版俄罗斯方块
- 毕业设计-C++俄罗斯方块
- vc6.0的MFC实现简单的俄罗斯方块小游戏
- 俄罗斯方块(基于VC6.0单文档)
- MFC俄罗斯方块及源码
- 小程序 俄罗斯方块
- 最简单的C语言俄罗斯方块
- c语言实现俄罗斯方块
- VS2013写的简单小游戏俄罗斯方块
- 俄罗斯方块游戏设计C++课程设计报告
- 基于VC6.0 的MFC俄罗斯方块游戏设计含
- 俄罗斯方块(C语言实现,有注释
评论
共有 条评论