arrow.h

来自「 ?跳舞机的源代码 自己修改一下 编译没有问题」· C头文件 代码 · 共 70 行

H
70
字号
//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 + =
减小字号Ctrl + -
显示快捷键?