script_stage_main
{
	let imgSunset = GetCurrentScriptDirectory ~ "img/sunset.png";
	let imgSunsetb = GetCurrentScriptDirectory ~ "img/sunsetb.png";
	let music = GetCurrentScriptDirectory ~ "bgm/fires.wav";
	let frame = 0;
	let alpha = 0;
	
	@Initialize
	{
		LoadGraphic(imgSunset);
		LoadGraphic(imgSunsetb);
		PlayMusic(music);
		SetAllowedContinueCount(0);
		//Expert;
	}

	@MainLoop
	{
		SetRateScoreSystemEnable(false);
		frame++;
		//Beginning glow alpha
		if(frame > 785 && alpha < 234)
		{
			alpha += 2;
		}
		if(frame == 1070)
		{
			CreateEnemyBossFromFile(GetCurrentScriptDirectory ~ "pluralheaven.txt", 0, 0, 0, 0, 0);
		}
	}

	@BackGround
	{
		//Beginning throbs
		if(frame > 125 && frame < 140){Throb(25);}
		if(frame > 210 && frame < 225){Throb(50);}
		if(frame > 290 && frame < 305){Throb(75);}
		if(frame > 375 && frame < 390){Throb(100);}
		if(frame > 456 && frame < 471){Throb(150);}
		if(frame > 540 && frame < 554){Throb(200);}
		if(frame > 624 && frame < 639){Throb(255);}
		if(frame > 705 && frame < 720){Throb(255);}

		//Beginning glow
		if(frame > 785 && frame < 6080)
		{
			SetTexture(imgSunsetb);
			SetGraphicRect(0, 0, 383, 190);
			SetGraphicScale(1, 1);
			SetAlpha(20+alpha);
			DrawGraphic(GetCenterX, GetCenterY-140);
		}
		
	}

	@Finalize
	{
	}
	
	function Throb(alpha)
	{
			SetTexture(imgSunset);
			SetGraphicRect(0, 0, 383, 209);
			SetGraphicScale(1, 1);
			SetAlpha(alpha);
			DrawGraphic(GetCenterX, GetCenterY-120);
	}
}