实训的项目
第一天 安装软件
开发工具:CodeBlocks
语言:c语言
第二天 开始敲代码
第二天的效果图如下:
下面是day2.h 头文件
#ifndef _DAY2_H
#define _DAY2_H
#include<stdbool.h>
#include<windows.h>
HANDLE Output;//设一个int型的句柄变量
//存储游戏相关数据的结构体
typedef struct TetrisManager//俄罗斯管理
{
unsigned int pool[28];//游戏池
int x;//当前方块的x坐标,左上角坐标
int y;//
int type[3];//当前,下一个,下下一个方块的类型
int orientation[3];//当前,下一个,下下一个方块的旋转状态
//左边栏
unsigned score;//得分
unsigned erasedTotal;//消行总数
unsigned erasedCount[4];//消几行数
unsigned tetrisTotal;//目前出现方块总数
unsigned tetrisCount[7];//目前出现各种方块数
bool dead;//挂
}Manager;
//构造存储游戏控制的相关数据的结构体
typedef struct TetrisControl
{
bool pause;//暂停
bool clockwise;//旋转方向
int direction;//移动方向,0做移,1右移
//游戏池内每格颜色
//此版本是彩色的,如果仅用游戏池数据无法储存颜色
int color[28][16];
}Control;
//函数声明
void printPoolBorder();//显示游戏池边界
void gotoxyWithFullwidth(short x,short y);//设置光标位置
void printPrompting()