lifeTime = GUI_Slider(
   99900.00,
   "Tiempo de Vida",
   0,100000);

gParticlesPerSecond = GUI_Slider(
   199.80,
   "Particle Creation Rate",
   1,200);

gCreationRange = GUI_Slider(
   61.00,
   "Blur Generation Range",
   0,1000);

gEmitSpeed = GUI_Slider(
   199.80,
      "Emitter Speed",
      0,200);

gScale = GUI_Slider(
   1.10,
      "Scale",
      0,3.0);

gBlendMode = GUI_Select(
   kBlendAdditiveAlpha,
   "Blend Mode",
   {
      { description="Normal", value=kBlendNormal},
      { description="Additive Alpha", value=kBlendAdditiveAlpha},
      { description="Subtractive", value=kBlendSubtractive},
      { description="Multiplicative", value=kBlendMultiplicative},
      { description="Opaque", value=kBlendOpaque}
   }
);

gTextureName = GUI_PickTexture("animations/fluidfx/particleassets/noise","Particle Texture");

gMaxParticles = GUI_Slider(
   999.00,
      "Max Particles",
      0,1000);

pOffset = Allocate(2) ; -- Allocate a Vec2 velocity member
pAge = Allocate(1) ; -- Allocate a TReal age member
SetTexture(gTextureName);
SetBlendMode(gBlendMode);
SetNumParticles(gMaxParticles);

pOffset:Init( f2dRadius( gCreationRange ) );

-- Start scale at 0.5
pScale:Init( gScale );

-- Start age as 0 milliseconds
pAge:Init(0);

-- ------------------------------------------------------------
-- Particle Parameter Animation Functions
--
pPosition:Anim( pOffset +dLocus);

-- Fade (using age) from white to yellow to black. Assumes
-- the first parameter is a number of elapsed milliseconds,
-- though can work to linearly interpolate using first 
-- scalar parameter between any value types.
pColor:Anim( 
   fFade( pAge,
      Color(1,1,1,0),100,
      Color(1,1,1,0.5),900,
      Color(1,1,1,0) ) -- to final color
   );

-- Age the particle using age function
pAge:Anim( pAge+fAge() );

-- General Anim functions
-- Expire particles over 700 ms old
Anim( fExpire( fGreater(pAge,1000) ) );

-- A function to run as we're executing
-- seconds - how many seconds have elapsed

gActiveTime = 3;

function Update(seconds)
   --if (gActiveTime > 0) then
     -- gActiveTime = gActiveTime - seconds / 2;
      CreateParticles( seconds * gEmitSpeed );
   --end
   --if (GetParticleCount() == 0) then
     -- Done();
   --end
end

