#ifndef PARTICLE_H
#define PARTICLE_H

#include "stdafx.h"
#include "globals.h"

class Particle
{
public:
	Particle();
	~Particle();

	void initData();//随意初始化方向、颜色、位置、尺寸
	bool isOutBoundary() {//	判断是否越界
		if (fabs(m_posX) > SCREEN_WIDTH / 2
			|| fabs(m_posY) > SCREEN_HEIGHT / 2)
			return true;
		else
			return false;
	}
	bool isDead() {//	判断是否超过生命周期
		if (m_liveTime <= 0)
			return true;
		else
			return false;
	}
	void calNewPos();//	计算新位置



	float m_size; //尺寸
	float m_direction;//	方向
	float m_speed;//	速度
	float m_posX, m_posY;//	此时的位置
	sRGB m_color;//	颜色
	int m_liveTime;//	生命周期
	

};

#endif

