sprite.h

来自「这是个很不错的飞行游戏源码」· C头文件 代码 · 共 29 行

H
29
字号
#ifndef SPRITE_H
#define SPRITE_H

class Sprite
{
protected:
	GameWorld *pGameWorld;
	int		ExplosionFrameCount, ExplosionFrameIndex;
	double x, y;
	void AdjustPosition();
public:
	int sx, sy, w, h;			// 在素材位图中的位置
	int cx, cy, cw, ch;			// 碰撞检测用矩形
	int Life, Atackness;
	double dx, dy;
	bool Used;

	bool OutOfClient();
	bool OutOfSight();
	int GetX(){ return (int)x; }
	int GetY(){ return (int)y; }
	void SetX(int x_value){ x=x_value; }
	void SetY(int y_value){ y=y_value; }
	Sprite(GameWorld *pgw, int x_value, int y_value);
	virtual void Update();
};


#endif

⌨️ 快捷键说明

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