local t = Def.ActorFrame{
	LoadActor(THEME:GetPathB("","_black"));
	-- header background
	Def.Quad{
		InitCommand=cmd(diffuse,color("0,0,0,1");stretchto,SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_TOP+48;diffusetopedge,color("0.4,0.4,0.4,1"));
	};
};

local xLocations = {};
local zooms = {};

--local orb = LoadActor( "_particle bubble" )..{
--local orb = LoadActor( "bubble2" )..{
--local orb = LoadActor( "bubble3" )..{
local orb = LoadActor( "bubble5" )..{
	InitCommand=cmd(diffusealpha,0.8;playcommand,"MakeNew";blend,"BlendMode_Add");
	MakeNewCommand=function(self)
		-- first, set the position.
		local xStart = math.random(32,256);
		local yPos = math.random(SCREEN_CENTER_Y-160,SCREEN_CENTER_Y);
		
		-- if there's no entries in the xLocations table, don't check for
		-- duplicate spots yet. this hack was made to spread out the bubbles
		-- somewhat, as there'd be a lot of bubbles invariably popping up
		-- on top of each other with the same movement speed, making a
		-- giant ball of glowy crap that I didn't want.
		if(#xLocations > 1) then
			-- then check it against the table.
			for i=0,#xLocations do
				-- if it's in the table, re-roll the generator
				if xLocations[i] == xStart then
					xStart = math.random(32,256);
				end;
			end;
		end;
		
		table.insert(xLocations, xStart);
		
		self:x( SCREEN_LEFT-xStart );
		self:y( yPos );
		
		-- then, set the zoom.
		local zoom = clamp( math.random(), 0.15, 0.5 );
		
		-- now check it for other zooms in the table
		if(#zooms > 1) then
			for i=0,#zooms do
				if zooms[i] == zoom then
					zoom = clamp( math.random(), 0.15, 0.5 );
				end;
			end;
		end;
		table.insert(zooms, zoom);
		
		self:zoom( zoom );
		
		-- using the zoom, get the "weight" of the particle
		local weight = self:GetZoom();
		--self:linear( math.random(5,10) );
		
		-- set a random rotation because not all bubbles are alike...
		local rotation = math.random(0,359);
		self:rotationz( rotation );
		
		-- then make it move
		self:linear( weight * 12 );
		self:addx(SCREEN_WIDTH+xStart+64);
		self:sleep( math.random(0,0.5) );
		self:queuecommand("MakeNew");
	end;
};

for i=1,30 do
	table.insert(t, Def.ActorFrame{ orb });
end;

-- fog in the background I guess
t[#t+1] = LoadActor("clouds")..{
	InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT+(SCREEN_HEIGHT);blend,'BlendMode_Add';diffusealpha,0.4);
	OnCommand=cmd(texcoordvelocity,-0.2,0;customtexturerect,0,0,2,1.5;diffuseshift;effectperiod,20);
};

return t;

-- particle code by Synikal, not exactly for re-use yet. perhaps when
-- [SMUG]General.Lua.Functions comes out, maybe.