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

📄 person.h

📁 自己编的一个游戏魂斗罗-宠物精灵版
💻 H
字号:
#ifndef _Person_H
#define _Person_H

#include"stdafx.h"

class Person
{
protected:
    int hp;
	int x,y;
	RECT r;

    
public:
	Person(){hp=1;x=0;y=0;}
	Person(int h){hp=h;x=0;y=0;}
	~Person(){}
	int gethp()const {return hp;}
	void goright(int d){x+=d;}
	void goleft(int d){x-=d;}
	void goup(int d){y-=d;}
	void godown(int d){y+=d;}
	int getx()const {return x;}
	int gety()const {return y;}
    void setpos(int a,int b)
	{
		x=a;
		y=b;
	}
	RECT * getrect()
	{
		return &r;
	}
	void setrect(int left,int right,int top,int bottom)
	{
		r.right=right;
		r.left=left;
		r.top=top;
		r.bottom=bottom;
	}
	void getshooted(){hp--;}
};


#endif

⌨️ 快捷键说明

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