• 大小: 0.03M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-04-13
  • 语言: C/C++
  • 标签: 俄罗斯  

资源简介


资源截图

代码片段和文件信息

#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


评论

共有 条评论