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

-- Set the particle texture
pAge = Allocate(1);

SetTexture("fx/images/etincelle");
SetBlendMode(kBlendNormal);

SetNumParticles(250);    -- Create some particles

pPosition:Init( fRange( Vec2(0,0), Vec2(1024,728) ));
pColor:Init( Color(1,1,1,1) );
pScale:Init( fRange(0.3,0.8) );
pUp:Init( f2dRadius( fRange(0,1) ) );   -- random radius
pAge:Init(0);

-- Move the particles
pAge:Anim(pAge + fAge());
pPosition:Anim( pPosition + fTimeScale( Vec2(0,60) ) );

pColor:Anim(fFade(pAge,fPick(Color(1,1,1,1),Color(1,1,1,0)),1500,Color(1,1,1,0))    );




-- Expire particles lower than 300
Anim( fExpire( fGreater(pAge,1500) ) );
CreateParticles(250 );

