⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cube.h

📁 简单的windows api编程实现的俄罗斯方块 希望对初学visual c的您有帮助 高手就不用看了
💻 H
字号:
#include <string>
#include <windows.h>
#include <time.h>
#define WIDTH 10
#define HIGHT 30
#define SPEED 500
//---------------------------------------------------------------------------------
typedef struct pt 
{
	int x,y;
	struct pt *next;
}point;

typedef int count;
//---------------------------------------------------------------------------------
class cube
{
public:
	cube(cube &Cube);
	cube();
	void initCube(bool status[HIGHT + 2][WIDTH + 2]);
	void moveToLeft(bool status[HIGHT + 2][WIDTH + 2]);
	void moveToRight(bool status[HIGHT + 2][WIDTH + 2]);
	bool down(bool status[HIGHT + 2][WIDTH + 2], int &score);
	bool drop(bool status[HIGHT + 2][WIDTH + 2], int &score);
	void change(bool status[HIGHT + 2][WIDTH + 2]);
	bool fixup(bool status[HIGHT + 2][WIDTH + 2], int &score);
	void creatCube(bool status[HIGHT + 2][WIDTH + 2]);
	bool loss(bool status[HIGHT + 2][WIDTH + 2]);
	point* getHead();
	point* getNextHead();
	~cube();
private:
	int shape, nextshape;
	int direction;
	point *head, *nextHead;
};
//---------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -