-- Additional parameters

pVelocity = Allocate( 2 ) ;

-- Set the particle texture
SetTexture("snow");
SetBlendMode(kBlendAdditiveAlpha);

SetNumParticles(10000);    -- Create some particles

pPosition:Init( fRange(Vec2(-267,0), Vec2(267,0)));
pColor:Init( Color(1,1,1,1) );
pScale:Init( fRange( 0.1, 0.2 ) );
pUp:Init( f2dRadius( 1 ) );   -- random radius
pVelocity:Init( fRange( Vec2( 0, 40 ), Vec2( 0, 80 ) ) ) ;

-- Move the particles
pPosition:Anim( pPosition +fTimeScale( pVelocity ) );

-- Expire particles lower than 300
Anim( fExpire( fGreater(pPosition[2],275) ) );

-- A function to run as we're executing
-- seconds - how many seconds have elapsed
function Update(seconds)
   -- Create 10 particles per second
   CreateParticles( seconds * 80 );
end

