gControl0007 = GUI_Slider(
	4.00,
   "Particles Count",
   0,10);

gControl0006 = GUI_Slider(
	0.80,
   "Particles Per Second",
   0,10);

gControl0005 = GUI_Slider(
   1000,
   "Age",
   0,1000);

gControl0004 = GUI_Slider(
	90.00,
   "Gravity",
   -1000,1000);

gControl0003 = GUI_Slider(
	0.00,
   "Scale Per Second",
   0,100);

gControl0002 = GUI_Slider(
	0.70,
   "Init Scale",
   0,100);

gControl0001 = GUI_PickTexture("fx/plants/drop","Texture");

-- ------------------------------------------------------------
-- Define our particle characteristics

pVelocity = Allocate(2) ; -- Allocate a Vec2 velocity member
pAge = Allocate(1) ; -- Allocate a TReal age member


-- Set the blend mode
SetBlendMode(kBlendNormal);
SetTexture(gControl0001);
SetNumParticles(gControl0007);

-- ------------------------------------------------------------
if not dLocus then
   dLocus= Vec2(0,0) ; 
end
pPosition:Init( fPick(   Vec2(-45, 7),
                     Vec2(-16, 32),
                     Vec2(16, 32),
                     Vec2(15, 7)

            )+ dLocus );

pVelocity:Init(Vec2(0,0));

pScale:Init( gControl0002 );
pAge:Init(0);

-- ------------------------------------------------------------
pPosition:Anim( pPosition + fTimeScale(pVelocity) );

pScale:Anim( pScale + fTimeScale(gControl0003) );

pVelocity:Anim(pVelocity + fTimeScale(Vec2(0,gControl0004))) ;

pAge:Anim( pAge+fAge() );

pColor:Anim(fAlpha(pColor, fFade( pAge, 1, 700, 0.7, 300, 0.1 )));
   
Anim( fExpire( fGreater(pAge, gControl0005) ) );

-- ------------------------------------------------------------
gActive = true;
function Update(seconds)
   if gActive then
      CreateParticles(seconds * gControl0006);
   end
end
