sw = SCREEN_WIDTH
sh = SCREEN_HEIGHT
scx = sw/2
scy = sh/2

viking_cacti = {}
viking_watercontainer = {}
viking_water = {}
viking_darkcloud = {}
viking_accessories2 = {}

return Def.ActorFrame{

	InitCommand=function(self)
		
	end,
	
	Def.Quad{
		OnCommand=cmd(scaletocover,0,0,sw,sh;diffuse,0,0,0,1;),
	},
	
	
	
	LoadActor("../lua/darksky.png")..{
		InitCommand=function(self) viking_sea_sky = self end,
		OnCommand=cmd(scaletocover,0,0,sw,sh)
	},
	LoadActor("../lua/race_sky.png")..{
		InitCommand=function(self) viking_sea_sky_bright = self end,
		OnCommand=cmd(diffusealpha,0;scaletocover,0,0,sw,sh),
		ThunderMessageCommand=cmd(diffusealpha,1;linear,1;diffusealpha,0;)
	},
	LoadActor("../lua/darkclouds.png")..{
		MakeCommand=function(self) viking_darkcloud[1] = self end,
		OnCommand=cmd(diffuse,.7,.7,.7,1;valign,0;xy,scx,sh*.05;basezoom,.5*sh/480;zoomx,6;
		customtexturerect,0,0,6,1;texcoordvelocity,.04,0,cropbottom,0.02;queuecommand,"Make"),
	},
	LoadActor("../lua/darkclouds.png")..{
		MakeCommand=function(self) viking_darkcloud[2] = self end,
		OnCommand=cmd(diffuse,.85,.85,.85,1;valign,0;xy,scx,sh*-0.2;basezoom,1*sh/480;zoomx,4;
		customtexturerect,0,0,4,1;texcoordvelocity,.04,0;cropbottom,0.02;queuecommand,"Make"),
	},
	LoadActor("../lua/thunder.png")..{
		InitCommand=function(self) viking_thunder = self end,
		OnCommand=cmd(diffusealpha,0;valign,0;xy,scx,0;basezoom,sh/480;),
		ThunderMessageCommand=cmd(diffusealpha,1;linear,1;diffusealpha,0;)
	},
	
	
	LoadActor("../lua/wave.png")..{
		MakeCommand=function(self) viking_water[1] = self end,
		OnCommand=cmd(diffuse,.7,.7,.7,1;valign,1;xy,scx,sh*.85;basezoom,.5*sh/480;zoomx,6;
		customtexturerect,0,0,6,1;texcoordvelocity,.04,0,croptop,0.02;queuecommand,"Make"),
	},
	Def.Quad{
		InitCommand=function(self) viking_water_cover = self end,
		OnCommand=cmd(zoomto,sw*1.2,sh*1.2;x,scx;y,scy+sh*1.1;diffuse,0,.2*.85,.4*.85,1),
	},
	LoadActor("../lua/wave.png")..{
		MakeCommand=function(self) viking_water[2] = self end,
		OnCommand=cmd(diffuse,.85,.85,.85,1;valign,1;xy,scx,sh*1.15;basezoom,1*sh/480;zoomx,4;
		customtexturerect,0,0,4,1;texcoordvelocity,.04,0;croptop,0.02;queuecommand,"Make"),
	},
	LoadActor("../lua/ocean.png")..{
		InitCommand=function(self) viking_ocean = self end,
		OnCommand=cmd(diffusealpha,0;zoomto,sw,sh;xy,scx,scy),
	},
	LoadActor("../lua/bubbles.png")..{
		InitCommand=function(self) viking_bubbles2 = self end,
		OnCommand=cmd(xy,scx,scy;basezoom,.5*sh/480;zoom,16;wag;effectperiod,8;effectmagnitude,0,0,3;
		customtexturerect,0,0,6,6;texcoordvelocity,0,2,croptop,0.02;diffuse,.8,.8,1,0),
	},
	
	
	LoadActor("../lua/rainfall.png")..{
		OnCommand=cmd(xy,scx,scy;basezoom,.5*sh/480;zoom,16;wag;skewx,-.35;effectperiod,9;effectmagnitude,0,0,4;
		customtexturerect,0,0,9,9;texcoordvelocity,0,-3,croptop,0.02;diffuse,.6,.6,.8,0),
		BoatOnMessageCommand=cmd(linear,120/133;diffusealpha,.5),
		BoatKillMessageCommand=cmd(linear,120/133;diffusealpha,0),
	},
	
	LoadActor("../back.png")..{
		InitCommand=function(self) viking_bg1 = self end,
		OnCommand=cmd(scaletocover,0,0,sw,sh)
	},
	
	Def.ActorFrame{
		InitCommand=function(self) viking_accessories2[1] = self end,
		OnCommand=cmd(xy,scx,scy;basezoom,SCREEN_HEIGHT/480;),
		LoadActor("../lua/boat_back.png")..{
			OnCommand=cmd(basezoom,.9;y,100+150;diffusealpha,0),
			BoatOnMessageCommand=cmd(stoptweening;diffusealpha,0;zoom,1;decelerate,120/133;y,100;diffusealpha,1),
			BoatKillMessageCommand=cmd(
				stoptweening;zoom,1;linear,120/133;addx,-200;addy,-200;rotationz,-360;diffusealpha,0;zoom,.5
			)
		},
	},
	Def.ActorFrame{
		InitCommand=function(self) viking_accessories2[2] = self end,
		OnCommand=cmd(xy,scx,scy;basezoom,SCREEN_HEIGHT/480;),
		LoadActor("../lua/boat_back.png")..{
			OnCommand=cmd(basezoom,.9;y,100+150;diffusealpha,0),
			BoatOnMessageCommand=cmd(stoptweening;diffusealpha,0;zoom,1;decelerate,120/133;y,100;diffusealpha,1),
			BoatKillMessageCommand=cmd(
				stoptweening;zoom,1;linear,120/133;addx,200;addy,-200;rotationz,-360;diffusealpha,0;zoom,.5
			)
		},
	},
	
	
	Def.ActorFrame{
		InitCommand=function(self) viking_arizona = self end,
		OnCommand=cmd(visible,false),
		LoadActor("../lua/race_sky.png")..{
			InitCommand=function(self) viking_arizona_sky = self end,
			OnCommand=cmd(scaletocover,0,0,sw,sh)
		},
		LoadActor("../lua/arizona.png")..{
			InitCommand=function(self) viking_arizona_bg = self end,
			OnCommand=cmd(valign,1;xy,scx,SCREEN_BOTTOM;basezoom,sh/480;zoomx,2;
			customtexturerect,0,0,2,1;texcoordvelocity,.005,0),
		},
		LoadActor("../lua/cacti.png")..{
			MakeCommand=function(self) viking_cacti[1] = self end,
			OnCommand=cmd(valign,1;xy,scx,sh * .7;basezoom,.5*sh/480;zoomx,3;
			customtexturerect,0,0,3,1;texcoordvelocity,.06,0;queuecommand,"Make"),
		},
		LoadActor("../lua/cacti.png")..{
			MakeCommand=function(self) viking_cacti[2] = self end,
			OnCommand=cmd(valign,1;xy,scx,sh * .85;basezoom,sh/480;zoomx,2;
			customtexturerect,0,0,2,1;texcoordvelocity,.06,0;queuecommand,"Make"),
		},
	},
	
	LoadActor("../lua/beach.png")..{
		InitCommand=function(self) viking_beach = self end,
		OnCommand=cmd(diffusealpha,0;scaletocover,0,0,sw,sh),
	},
	
	Def.Quad{
		InitCommand=function(self) viking_hv_back = self end,
		OnCommand=cmd(scaletocover,0,0,sw,sh;diffuse,0,0,0,0;),
	},
	
	Def.ActorFrame{
		InitCommand=function(self) viking_heaven = self end,
		OnCommand=cmd(xy,scx,scy;visible,false),
		
		LoadActor("../lua/heaven.png")..{
			OnCommand=cmd(scaletocover,0,0,sw,sh;addx,-scx;addy,-scy;),
		},
		LoadActor("../lua/hvn-gray.png")..{
			InitCommand=function(self) viking_grayhvn = self end,
			OnCommand=cmd(diffusealpha,0;scaletocover,0,0,sw,sh;addx,-scx;addy,-scy;),
		},
		Def.Quad{
			OnCommand=cmd(scaletocover,-100,0,sw+100,sh;diffuse,0,0,0,1;basezoom,1.2;fadetop,.15;valign,0;y,sh*.85;addx,-scx;addy,-scy;),
		},
	},
	
	Def.Quad{
		InitCommand=function(self) viking_bgdim = self end,
		OnCommand=cmd(scaletocover,0,0,sw,sh;diffuse,0,0,0,0;),
	},
	
	LoadActor("../back.png")..{
		InitCommand=function(self) viking_finalbg = self end,
		OnCommand=cmd(scaletocover,0,0,sw,sh;diffusealpha,0)
	},

}