📄 arrow.h
字号:
//arrow.h
#include<ddraw.h>
#pragma comment(lib,"ddraw")
extern posx,posy;
extern HWND hWnd;
class ARROW
{
private:
DWORD time;
int aposx;
int aposy;
bool enable;
bool move;
int direction;
public:
int flag;
ARROW()
{
this->direction=rand()%4;
this->enable=true;
this->move=false;
this->flag=4;
this->time=timeGetTime();
switch(direction)
{
case 0:
{
this->aposx=70;
this->aposy=768;
}
break;
case 1:
{
this->aposx=170;
this->aposy=768;
}
break;
case 2:
{
this->aposx=290;
this->aposy=768;
}
break;
case 3:
{
this->aposx=390;
this->aposy=768;
}
break;
default:
MessageBox(hWnd,"程序内部出错,请重新开启游戏!", "",MB_OK);
break;
}
}
void ArrowMove();//箭头移动
int GetPosx(){return aposx;}
int GetPosy(){return aposy;}
bool GetMove(){return move;}
int GetDirection(){return direction;}
void SetMove(bool x){move=x;}
void SetEnable(bool x){enable=x;}
void SetDirection(int x){direction=x;}
void SetPosx(int x){posx=x;}
void SetPosy(int y){posy=y;}
void TIME(){time=timeGetTime();}
//int RandArrow();//随机产生箭头
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -