CBullet.h 521 Bytes
Newer Older
CjhGm's avatar
CjhGm committed
1
2
3
#pragma once
#include "GameObject.h"

CjhGm's avatar
CjhGm committed
4
5
6
#define BULLET_HEIGHT 60	//战机子弹高都为20
#define BULLET_WIDTH 30		//战机子弹宽
#define BULLET_SPEED 30		//子弹飞行速度
CjhGm's avatar
CjhGm committed
7

CjhGm's avatar
CjhGm committed
8
9
10
11
class CBullet :	public CGameObject
{
private:
	int speed;
CjhGm's avatar
CjhGm committed
12
	int damage;
CjhGm's avatar
CjhGm committed
13
14
15
16
17

protected:
	static CImageList bulletImages; // 子弹图像
	
public:
CjhGm's avatar
CjhGm committed
18
	CBullet(int x, int y, int _damage, int _speed = BULLET_SPEED);
CjhGm's avatar
CjhGm committed
19
	int getSpeed() const;
CjhGm's avatar
CjhGm committed
20
	int getDamage() const;
CjhGm's avatar
CjhGm committed
21
22
23
24
25
26
27
28
29
30
31

	CRect GetRect();

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

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

};