/*
 * Particle.h
 *
 *  Created on: 2009-07-11
 *      Author: wasyl
 */

#ifndef PARTICLE_H_
#define PARTICLE_H_

#include <allegro5/allegro.h>
#include "../prep/misc/Vector2D.h"
#include "../prep/ent/Entity.h"
#include "../prep/res/Sheet.h"

class Particle : public Entity
{
protected:
	ALLEGRO_BITMAP *mBmp;
	Vec mVel;
	double mLife, mInitial;
	double mBraking;
	int mBlend;

public:
	Particle(const char *bmp, Vec pos, Vec mVel, double mLife, double mBraking, int blend);

	int *indices()
	{
		static int ind[] = {ID("entt"), ID("rndr"), ID("dyna"), 0};
		return ind;
	}

	int order(int index)
	{
		if (index == ID("rndr"))
			return 80;
		else
			return (int)this;
	}

	void update(double dt);
	void render();
};

#endif /* PARTICLE_H_ */
