TImage *Sang;

int partactive=false;
int partX;
int partY;
int partsang;
bool partdir;

void InitParticles (int x,int y,bool dir)
{
  partactive=true;
  partX = x;
  partY = y;
  partsang=0;
  partdir=dir;
}

void Particles ()
{
  if (partactive)
  {
    partsang++;
    for (DWORD i=0; i<partsang; i++)
    {
      float y = (partsang-i); 
      float x = (partsang-i)*3;
      if (partdir) x*=-1;
      x+=partX;
      y+=partY;			
      PutPartRGB (GBL_Bits,(DWORD *)Sang->bits,x,y,32-(16-i));
    }
    if (partsang>16) partactive=false;
  }
}