mScale = GUI_Slider(
	2.00,
   "Scale",
   0,5);

mSpinSpeed = GUI_Slider(
   0.15,
   "Spin Speed (revolutions per second)",
   0,1);

mAlpha = GUI_Slider(
   1.00,
   "Alpha",
   0,1);

mTexture = GUI_PickTexture("fx/main_menu/sun_glow","Texture");

-- ------------------------------------------------------------
-- Global params

PI = 3.141592

mSpinSpeedRad = mSpinSpeed * 2 * PI;


-- ------------------------------------------------------------
-- Initialization phase

-- Define our custom particle properties
pSpin = Allocate(1); -- Allocate a TReal spin member
pSpinSpeed = Allocate(1); -- Allocate a TReal spin member

-- dLocus is a data source: An external connection to the particle
-- system. Here we define dLocus for FluidFX, since FluidFX doesn't know
-- to provide the data source; in the game it's defined in
-- swarm.cpp as a data source, and it gets the mouse position.
if not dLocus then
   dLocus= Vec2(0,0) ;
end

-- Set the particle texture
SetTexture(mTexture);

-- Set the blend mode
SetBlendMode(kBlendAdditiveAlpha);

-- LAST, we set the total number of particles in the particle
-- system. This doesn't 'create' the particles, but rather
-- allocates a block of 'dead' particles that can be created
-- below.
SetNumParticles(2);

-- ------------------------------------------------------------
-- Initialization

pPosition:Init( dLocus );

pSpin:Init(fRange(0, 2 * PI));
pSpinSpeed:Init(fClosedCycle(-mSpinSpeedRad, mSpinSpeedRad, 2));

pScale:Init(mScale);
pColor:Init(Color(1, 1, 1, mAlpha));

-- ------------------------------------------------------------
-- Animation

pPosition:Anim( dLocus );
pSpin:Anim( pSpin + fTimeScale( pSpinSpeed ) );
pUp:Anim( f2dRotation( pSpin ) );

Anim( fExpire( false ) );

-- ------------------------------------------------------------

-- Create an initial particle (optional)
CreateParticles(2);

-- A function to run as we're executing
-- seconds - how many seconds have elapsed
function Update(seconds)
end

