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

-- Set the particle texture
SetTexture("star");
SetBlendMode(kBlendNormal);

SetNumParticles(10);    -- Create some particles

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

pSpin:Init( 0);
pSpinSpeed:Init(4);

--pPosition:Anim(pPosition); -- f2dRotation(NextAngle(nb part));
pPosition:Anim( pPosition );
--pScale:Anim( pScale + fTimeScale(1) );
pColor:Anim( pColor );
pSpin:Anim( pSpin + fTimeScale( pSpinSpeed ) );
pUp:Anim(  f2dRotation( pSpin )  + 1 );
-- Add time to the age
pAge:Anim( pAge+fAge() );

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

-- 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 * 1 );
end

