CEnemy.h 625 Bytes
Newer Older
CjhGm's avatar
CjhGm committed
1
2
#pragma once
#include "GameObject.h"
CjhGm's avatar
CjhGm committed
3
#include "CPlane.h"
CjhGm's avatar
CjhGm committed
4

CjhGm's avatar
CjhGm committed
5
6
7
8
9
10
#define ENEMY_HEIGHT	90		// 敌机的高度
#define ENEMY_WIDTH		120		// 敌机的宽度
#define ENEMY_SPEED		3		// 敌机飞行速度
#define ENEMY_HP		1		// 敌机血量
#define ENEMY_DAMAGE	1		// 敌机伤害
#define ENEMY_SCORE		10		// 敌机分数
CjhGm's avatar
CjhGm committed
11

CjhGm's avatar
CjhGm committed
12
class CEnemy : public CPlane
CjhGm's avatar
CjhGm committed
13
{
CjhGm's avatar
CjhGm committed
14
15
private:
	int score;
CjhGm's avatar
CjhGm committed
16
17
18
19
20
protected:
	static CImageList enemyImages; //敌机图像

public:
	CEnemy(int window_width, int window_heigh);
CjhGm's avatar
CjhGm committed
21
	int getScore() const;
CjhGm's avatar
CjhGm committed
22
23
24
25
26
27
28
29
30
31
32

	CRect GetRect();

	//绘制
	BOOL Draw(CDC* pDC, BOOL bPause);
	BOOL Draw(CDC* pDC, int passNum, BOOL bPause);

	//加载敌机图像
	static BOOL LoadImage();
};