---------------------------------------------------------------------
--   Author: Xavier Richter
--   Copyright (c) GIMAGIN 2009, All Rights Reserved.
---------------------------------------------------------------------

-- Define our particle characteristics
pAge = Allocate(1) ; -- Allocate a TReal age member
pRadius = Allocate(1); -- Allocate a TReal radius member
pBirth = Allocate(1); -- Allocate a TReal radius member

-- Set the particle texture
SetTexture("fx/images/feu_folet_medium_blue.png");
SetBlendMode(kBlendNormal);

SetNumParticles(10);    -- Create some particles

pRadius:Init(36); -- rayon en pixel 36
pColor:Init( Color(1,1,1,1) );
pScale:Init(0.9);
pAge:Init(0);
pPosition:Init(f2dRotation(fAngleCircle(0,10))*pRadius + dLocus );  -- position around dlocus
pBirth:Init(fAge());


pPosition:Anim( pPosition );
pScale:Anim(pScale-fTimeScale(0.5));

-- Add time to the age
pAge:Anim( pAge+fAge() );

-- Expire particles over 1500 ms old
Anim( fExpire( fGreater(pAge,1000) ) );

-- Create an initial particle
-- CreateParticles(10);

-- A function to run as we're executing
-- seconds - how many seconds have elapsed
function Update(seconds)
   -- Create 10 particles per second
   --CreateParticles( seconds * 2000000000 );
   --if fLessEqual(GetParticleCount(),7) then
		CreateParticles( seconds * 10 );
	--end
end

