📄 cube.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 + -