#ifndef ULONG
#define ULONG unsigned long
#endif

class spart
{
public:;
	float x,y,z;
	float dx,dy,dz;
	ULONG startTime;
	ULONG time;
	bool  active;

	void create()
	{
		 x = 0;
		 y = 0;
		 z = 0;
		 startTime = MyGetTickCount();
		 dx = 0.2f * ((float)(rand()-(RAND_MAX>>1)) / (float)RAND_MAX);
		 dy = 0.2f * ((float)(rand()-(RAND_MAX>>1)) / (float)RAND_MAX);
		 dz = 0.2f * ((float)(rand()-(RAND_MAX>>1)) / (float)RAND_MAX);
		 active = true;
	}

	void update()
	{
		if( active )
		{
			time = MyGetTickCount() - startTime;
			float t = (float)time;
			if( time >= PARTOVER ) 
			{
				create();
				return;
			}
			t /= 1000;

			x += t*dx;
			y += t*dy -0.1f*(t*t);
			z += t*dz;
		}
	}
};
