sub Stage5
{
	DeleteMusic(BGM[8]);
if(PreLoad==0)
{
	CreateEnemyFromFile(csd~"stage5/LoadEnemy.txt",0,0,0,0,1);
}

if(StagePractice==true && PreLoad>=1)
{
	CreateEnemyFromFile(csd~"stage5/LoadEnemy.txt",0,0,0,0,1);
if(StagePhaseProgress<=2)
{
CompileEnemyFromFile(csd~"stage5/Stage5BigEnemy1.txt");
CompileEnemyFromFile(csd~"stage5/Stage5BigEnemy2.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Elemental.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy01.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy02.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy02b.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy03.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy04.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy05.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy06.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy07.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy08.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy09.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy09a.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy10.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy11.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy12.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy13.txt");
CompileEnemyFromFile(csd~"stage5/Stage5Enemy14.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemyA.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemyRing1.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemyRing2.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemyRing3.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemyRing4.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemyRing5.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemyRing6.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemySnake1.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemySnake2.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemySnake3.txt");
CompileEnemyFromFile(csd~"stage5/Stage5EnemySnake4.txt");
}
if(StagePhaseProgress<=1)
{
CompileEnemyFromFile(csd~"stage5/Yuuka.txt");
CompileEnemyFromFile(csd~"stage5/BossEscape.txt");
}
CompileEnemyFromFile(csd~"stage5/Alice1.txt");
CompileEnemyFromFile(csd~"stage5/Alice2.txt");
CompileEnemyFromFile(csd~"stage5/Alice3.txt");
CompileEnemyFromFile(csd~"stage5/Alice4.txt");
CompileEnemyFromFile(csd~"stage5/BossDefeat.txt");
if(GetCommonDataDefault("SELECTEDDIFFICULT","None")=="Apocalypse")
{
CompileEnemyFromFile(csd~"stage5/Alice5.txt");
CompileEnemyFromFile(csd~"stage5/Alice6.txt");
CompileEnemyFromFile(csd~"stage5/Alice7.txt");
}
}

	if(StagePhaseProgress!=3 || StagePractice==false)
	{
	PlayMusic(BGM[9]);
	}
	SetCommonData("BurstStop",false);
	wait(120);

if(StagePhaseProgress==0 || StagePractice==false)
{
	Stage5Unit1;
	Stage5Unit2;
	wait(30);
	Stage5Unit3;
	wait(50);
	Stage5Unit5;
	wait(30);
	Stage5Unit4;
	Stage5Unit6;
	wait(40);
	Stage5Unit8;
	wait(50);
	Stage5Unit7;
	wait(30);
	Stage5Unit9;
	Stage5Unit2;
	wait(60);
	Stage5Unit10;
	wait(150);
	Stage5Unit11;
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyA.txt",GetCenterX+160,GetClipMinY-16,0.8,90,1);
	wait(90);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy05.txt",GetCenterX-120,GetClipMinY-16,2.0,90,1);
	wait(210);
	Stage5Unit12;
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyA.txt",GetCenterX+160,GetClipMinY-16,0.8,90,1);
	wait(120);
	Stage5Unit13;
	wait(210);
	Stage5Unit14;
	wait(60);
	Stage5Unit15;
	wait(60);
	Stage5Unit14;
	wait(60);
	Stage5Unit16;
	wait(180);
	Stage5Unit17;
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyA.txt",GetCenterX-160,GetClipMinY-16,0.8,90,-1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy07.txt",GetCenterX+100,GetClipMaxY+16,2.0,180,1);
	wait(240);
	Stage5Unit18;
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyA.txt",GetCenterX+160,GetClipMinY-16,0.8,90,1);
	wait(150);
	Stage5Unit19;
	wait(120);
	Stage5Unit20;
	wait(90);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyA.txt",GetCenterX-160,GetClipMinY-16,0.8,90,-1);
	wait(120);
	Stage5Unit21;
	wait(90);
	Stage5Unit22;
	wait(90);
	Stage5Unit23;
	wait(180);
	Stage5Unit21;
	wait(60);
	Stage5Unit22;
	wait(30);
	Stage5Unit24;
	wait(600);
	SetCommonData("Stage5Enemy6aStop",true);
	wait(240);
}
if(StagePhaseProgress<=1 || StagePractice==false)
{
//	Stage5SceneChange;
	SetCommonData("STAGE5MIDBOSS",true);
	SetCommonData("STAGE5MIDBOSSHAYAMAWASI",true);
	Stage5Hayamawasi;

	Stage5MidBossAppear;

	SetCommonData("STAGE5MIDBOSS",false);
	loop
	{
		if(GetCommonDataDefault("STAGE5MIDBOSSHAYAMAWASI",true)==false){break;}
		yield;
	}
	wait(60);
	Stage5SceneChange;
}
if(StagePhaseProgress<=2 || StagePractice==false)
{

	Stage5Unit25;
	wait(150);
	Stage5Unit26;
	wait(90);
	Stage5Unit27;
	wait(180);
	Stage5Unit28;
	wait(180);

	Stage5Unit29;
	wait(120);

	SetCommonData("BitZone",true);

	CreateEnemyFromFile(csd~"stage5/Stage5EnemyRing1.txt",GetClipMaxX,GetClipMinY-48,0.8,90,-1);
	wait(240);
	Stage5Unit30;
	wait(30);
	Stage5Unit31;
	wait(300);
	Stage5Unit32;
	wait(120);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyRing2.txt",GetClipMaxX+240,GetCenterY-60,0.8,90,-1);
	wait(60);
	Stage5Unit33;
	wait(120);
	Stage5Unit34;
	wait(240);

	SetCommonData("BitZone",false);

	Stage5Unit35;
	wait(60);
	Stage5Unit36;
	wait(240);
	Stage5Unit37;
	wait(240);
	SetCommonData("STAGE5BIGENEMY1HAYAMAWASI",true);
	Stage5Hayamawasi2;
	CreateEnemyFromFile(csd~"stage5/Stage5BigEnemy1.txt",GetCenterX,GetClipMinY-32,0.8,90,-1);
	wait(510);
	SetCommonData("Stage5MoveSignal0",true);
	wait(30);

	SetCommonData("BitZone",true);

	CreateEnemyFromFile(csd~"stage5/Stage5EnemyRing3.txt",GetClipMinX-240,GetCenterY-160,0.8,90,-1);
	wait(270);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyRing4.txt",GetClipMinX-240,GetCenterY+160,0.8,90,-1);
	wait(270);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyRing5.txt",GetClipMinX-240,GetCenterY-125,0.8,90,-1);
	wait(270);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemyRing6.txt",GetClipMinX-240,GetCenterY+130,0.8,90,-1);
	wait(450);

	SetCommonData("BitZone",false);

	Stage5Unit38;
	wait(390);
	Stage5Unit39;
	wait(60);
	SetCommonData("Stage5MoveSignal0",false);
	SetCommonData("Stage5MoveSignal1",true);
	Stage5Unit40;
	wait(120);
	Stage5Unit41;
	wait(180);
	CreateEnemyFromFile(csd~"stage5/Stage5BigEnemy2.txt",GetCenterX,GetClipMinY-32,0.8,90,-1);
	wait(30);
	Stage5Unit42;
	wait(390);
	Stage5Unit43;
	wait(120);


	Stage5Unit44;
	wait(240);
	SetCommonData("Stage5MoveSignal1",false);
	SetCommonData("Stage5MoveSignal2",true);
	wait(300);
	SetCommonData("Stage5MoveSignal2",false);
	SetCommonData("Stage5MoveSignal3",true);
	wait(180);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemySnake1.txt",GetCenterX-80,GetClipMinY-32,0.8,90,-1);
	wait(60);
	Stage5Unit45;
	wait(180);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemySnake2.txt",GetClipMaxX,GetCenterY-64,0.8,90,-1);
	wait(60);
	Stage5Unit46;
	wait(180);
	Stage5Unit47;
	CreateEnemyFromFile(csd~"stage5/Stage5EnemySnake3.txt",GetClipMaxX-64,GetClipMaxY+32,0.8,90,-1);
	wait(120);
	Stage5Unit48;
	wait(240);
	CreateEnemyFromFile(csd~"stage5/Stage5EnemySnake4.txt",GetClipMinX-32,GetClipMaxY-200,0.8,90,-1);
	wait(120);
	Stage5Unit49;
	wait(120);
	Stage5Unit50;
	wait(780);

	//wait(120);
	SetCommonData("Stage5MoveSignal3",false);
	SetCommonData("Stage5MoveSignal4",true);
	wait(150);
	SetCommonData("Stage5MoveSignal4",false);
	SetCommonData("Stage5MoveSignal5",true);
	wait(150);
	Stage5Phase=2;
	Stage5Unit51;
	wait(240);
	Stage5Unit52;
	wait(45);
	Stage5Unit53;
	wait(45);
	Stage5Unit54;
	wait(60);
	Stage5Unit55;
	wait(120);
	Stage5Unit56;
	Stage5Unit57;
	wait(105);
	Stage5Unit58;
	wait(165);
	Stage5Unit59;
	wait(330);
	Stage5Unit60;
	wait(90);
	Stage5Unit61;
	wait(180);
	Stage5Unit62;
	wait(90);
	Stage5Unit63;
	wait(300);
	SetCommonData("Stage5MoveSignal5",false);
	SetCommonData("Stage5MoveSignal6",true);
	Stage5Unit65;
	wait(720);
	FadeOutMusic(BGM[9],10);
	Stage5Phase=3;
	//CreateEnemyFromFile(csd~"stage5/Stage5Carrier.txt",GetCenterX,GetClipMinY-32,1.0,90,1);
	wait(600);
	wait(120);
}
if(StagePhaseProgress<=3 || StagePractice==false)
{
	DeleteMusic(BGM[9]);
	PlayMusic(BGM[10]);
	SetCommonData("STAGE5BOSS",true);
	wait(1);

	Stage5BossAppear;

	SetCommonData("STAGE5BOSS",false);
	CreateEnemyFromFile(csd~"stage5/DeleteEnemy.txt",GetClipMinX-64,GetCenterY-48,2,90,1);
}
}

function Stage5MidBossAppear
{
	if(GetCommonDataDefault("ExclusiveBoss",false)==true)
	{
		SetCommonData("IsMSDBossExisting",true);

		CreateEnemyFromFile(csd~"stage5/Yuuka.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
		WaitForZeroEnemy;
		CreateEnemyFromFile(csd~"stage5/BossEscape.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
		//WaitForZeroEnemy;
		loop
		{
			if(GetCommonDataDefault("YukaVanish",false)==true){break;}
			yield;
		}
		SetCommonData("IsMSDBossExisting",false);
	}
	else
	{
		CreateEnemyBossFromFile(csd~"stage5/Stage5MidBoss.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
		WaitForZeroEnemy;
	}
}

function Stage5BossAppear
{
	if(GetCommonDataDefault("ExclusiveBoss",false)==true)
	{
		SetCommonData("IsMSDBossExisting",true);

		CreateEnemyFromFile(csd~"stage5/Alice1.txt",GetCenterX,GetClipMinY-16,2,0,0);
		WaitForZeroEnemy;
		stage5phase=1;
		CreateEnemyFromFile(csd~"stage5/Alice2.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
		WaitForZeroEnemy;
		stage5phase=2;
		CreateEnemyFromFile(csd~"stage5/Alice3.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
		WaitForZeroEnemy;
		stage5phase=3;
		CreateEnemyFromFile(csd~"stage5/Alice4.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
		WaitForZeroEnemy;

		SetCommonData("IsMSDBossExisting",false);

		CreateEnemyFromFile(csd~"stage5/BossDefeat.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
		WaitForZeroEnemy;

		if(GetCommonDataDefault("SELECTEDDIFFICULT","None")=="Apocalypse")
		{
		if(GetCommonDataDefault("BalanceBreak",false)==false)
		{
		SetCommonData("TrueBossFlag",true);
		InitialContinue=0;
		}
		}
		if(GetCommonDataDefault("TrueBossFlag",false))
		{
			FadeOutMusic(BGM[10],15);
			wait(60);
			SetAllowedContinueCount(0);
			wait(300);
			SetCommonData("BurstStop",false);
			wait(119);
			SetCommonData("IsMSDBossExisting",true);
			DeleteStagefile(StageProgress);
		ClearByteCodeCache;

		if(PreLoad==1)
		{
		CompileEnemyFromFile(csd~"stage5/Alice5.txt");
		CompileEnemyFromFile(csd~"stage5/Alice6.txt");
		CompileEnemyFromFile(csd~"stage5/Alice7.txt");
		}
			wait(1);
			DeleteMusic(BGM[9]);
			PlayMusic(BGM[11]);
			CreateEnemyFromFile(csd~"stage5/Alice5.txt",GetCenterX,GetCenterY-120,2,0,0);
			WaitForZeroEnemy;
			CreateEnemyFromFile(csd~"stage5/Alice6.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
			WaitForZeroEnemy;
			SetCommonData("IsMSDBossExisting",false);
			yield;
			SetCommonData("IsMSDBossExisting",true);
			SetCommonData("LastTrueBossFlag",true);
			LastChargeEffect;
			CreateEnemyFromFile(csd~"stage5/Alice7.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
			WaitForZeroEnemy;
			FadeOutMusic(BGM[11],5);
			CreateEnemyFromFile(csd~"stage5/BossTrueDefeat.txt",GetClipMaxX-60,GetClipMinY-16,2,0,0);
			WaitForZeroEnemy;
		}

		SetCommonData("IsMSDBossExisting",false);
	}
	else
	{
		CreateEnemyBossFromFile(csd~"stage5/Stage5Boss.txt",GetClipMinX+60,GetClipMinY-16,2,0,0);
		WaitForZeroEnemy;
	}
}


task Stage5Hayamawasi
{
	HayaUnit1;
	loop(27)
	{
		if(GetCommonDataDefault("STAGE5MIDBOSS",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX+40,GetClipMinY-32,2.5,90,0);
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX-120,GetClipMinY-32,2.5,90,0);
		}
		wait(20);
		if(GetCommonDataDefault("STAGE5MIDBOSS",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX-80,GetClipMinY-32,2.5,90,0);
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX+80,GetClipMinY-32,2.5,90,0);
		}
		wait(20);
		if(GetCommonDataDefault("STAGE5MIDBOSS",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX-40,GetClipMinY-32,2.5,90,0);
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX+120,GetClipMinY-32,2.5,90,0);
		}
		wait(20);
		if(GetCommonDataDefault("STAGE5MIDBOSS",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX-80,GetClipMinY-32,2.5,90,0);
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX+80,GetClipMinY-32,2.5,90,0);
		}
		wait(20);
	}
	SetCommonData("STAGE5MIDBOSSHAYAMAWASI",false);

	task HayaUnit1
	{
	loop(9)
	{
		if(GetCommonDataDefault("STAGE5MIDBOSS",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+rand(80,120),GetClipMinY-32,1.5,90,0);
		}
		wait(60);
		if(GetCommonDataDefault("STAGE5MIDBOSS",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+rand(-20,20),GetClipMinY-32,1.5,90,0);
		}
		wait(60);
		if(GetCommonDataDefault("STAGE5MIDBOSS",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+rand(-80,-120),GetClipMinY-32,1.5,90,0);
		}
		wait(60);
		if(GetCommonDataDefault("STAGE5MIDBOSS",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+rand(-20,20),GetClipMinY-32,1.5,90,0);
		}
		wait(60);
	}
	}
}

task Stage5Hayamawasi2
{
	loop(300)
	{
		if(GetCommonDataDefault("STAGE5BIGENEMY1HAYAMAWASI",true)==false){break;}
		yield;
	}
	loop(10)
	{
	ascent(i in -3..4)
	{
		if(GetCommonDataDefault("STAGE5BIGENEMY1HAYAMAWASI",true)==false)
		{
			CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-48*i,GetClipMinY-16,0,0,1);
		}
	wait(5);
	}
	}
	SetCommonData("STAGE5BIGENEMY1HAYAMAWASI",false);
}

task Stage5Unit1
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-120,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-80,GetClipMinY-16,0,0,1);
}

task Stage5Unit2
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-60,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-0,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+60,GetClipMinY-16,1.2,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-40,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+20,GetClipMinY-16,1.2,90,1);
}

task Stage5Unit3
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+120,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+120,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+120,GetClipMinY-16,1,90,1);
}

task Stage5Unit4
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+80,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+100,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+120,GetClipMinY-16,0,0,1);
}

task Stage5Unit5
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+70,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+10,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-50,GetClipMinY-16,1.2,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+50,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-10,GetClipMinY-16,1.2,90,1);
}

task Stage5Unit6
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-120,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-120,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-120,GetClipMinY-16,1,90,1);
}

task Stage5Unit7
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-80,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-100,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-120,GetClipMinY-16,0,0,1);
}

task Stage5Unit8
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-70,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-10,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+50,GetClipMinY-16,1.2,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-50,GetClipMinY-16,1.2,90,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+10,GetClipMinY-16,1.2,90,1);
}

task Stage5Unit9
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+120,GetClipMinY-16,1,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+120,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-120,GetClipMinY-16,1,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-120,GetClipMinY-16,1,90,1);
}

task Stage5Unit10
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+120,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+80,GetClipMinY-16,0,0,1);
}

task Stage5Unit11
{
loop(8)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+105,GetClipMinY-16,1.2,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+60,GetClipMinY-16,1.2,90,1);
	wait(45);
}
}


task Stage5Unit12
{
loop(7)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-35,GetClipMinY-16,1.2,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+15,GetClipMinY-16,1.2,90,1);
	wait(45);
}
}

task Stage5Unit13
{
let y=0;
	loop(5)
	{
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetClipMinX-16,GetClipMinY-40+y,1.0,15,1);
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetClipMaxX+16,GetClipMinY+0+y,1.0,165,1);
		wait(45);
		y+=12;
	}
}

task Stage5Unit14
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-140,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-100,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-60,GetClipMinY-16,0,0,1);
}

task Stage5Unit15
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+140,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+60,GetClipMinY-16,0,0,1);
}

task Stage5Unit16
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX-120,GetClipMinY-16,1.1,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+0,GetClipMinY-16,1.1,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+120,GetClipMinY-16,1.1,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+0,GetClipMinY-16,1.1,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX-120,GetClipMinY-16,1.1,90,1);
}

task Stage5Unit17
{
loop(6)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-105,GetClipMinY-16,1.2,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-60,GetClipMinY-16,1.2,90,1);
	wait(45);
}
}

task Stage5Unit18
{
loop(4)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+105,GetClipMinY-16,1.2,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+60,GetClipMinY-16,1.2,90,1);
	wait(45);
}
}


task Stage5Unit19
{
loop(4)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-5,GetClipMinY-16,1.2,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+45,GetClipMinY-16,1.2,90,1);
	wait(45);
}
}

task Stage5Unit20
{
loop(8)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-105,GetClipMinY-16,1.2,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-60,GetClipMinY-16,1.2,90,1);
	wait(45);
}
}

task Stage5Unit21
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+60,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+140,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+80,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+120,GetClipMinY-16,0,0,1);
}

task Stage5Unit22
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-80,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-40,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+0,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-60,GetClipMinY-16,0,0,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-20,GetClipMinY-16,0,0,1);
}


task Stage5Unit23
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+120,GetClipMinY-16,1.1,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX+40,GetClipMinY-16,1.1,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX-40,GetClipMinY-16,1.1,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06.txt",GetCenterX-120,GetClipMinY-16,1.1,90,1);
}

task Stage5Unit24
{
	let EnemyCount=0;
	let X=[120,0,-120,0];
	let Index=0;
	loop(3)
	{
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+X[Index],GetClipMinY-16,1.5,90,EnemyCount);
		wait(30);
		EnemyCount+=1;
	}
	Index=1;
	EnemyCount=0;
	loop
	{
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+X[Index],GetClipMinY-16,1.5,90,EnemyCount);
		UnitWait(60);
		EnemyCount+=1;
		if(EnemyCount>=3)
		{
			EnemyCount=0;
			Index+=1;
			if(Index>=4)
			{
				Index=0;
			}
		}
		if(GetCommonDataDefault("Stage5Enemy6aStop",false)){break;}
	}
/*
	wait(50);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+120,GetClipMinY-16,1.5,90,1);
	wait(50);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+120,GetClipMinY-16,1.5,90,1);
	wait(48);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+120,GetClipMinY-16,1.5,90,1);
	wait(46);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+0,GetClipMinY-16,1.5,90,1);
	wait(44);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+0,GetClipMinY-16,1.5,90,1);
	wait(42);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+0,GetClipMinY-16,1.5,90,1);
	wait(40);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX-120,GetClipMinY-16,1.5,90,1);
	wait(38);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX-120,GetClipMinY-16,1.5,90,1);
	wait(36);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX-120,GetClipMinY-16,1.5,90,1);
	wait(34);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+0,GetClipMinY-16,1.5,90,1);
	wait(32);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+0,GetClipMinY-16,1.5,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy06a.txt",GetCenterX+0,GetClipMinY-16,1.5,90,1);
	wait(28);
*/
	function UnitWait(w)
	{
		let count=0;
		loop(w)
		{
			if(GetCommonDataDefault("Stage5Enemy6aNum",0)<3 && count>=15){break;}
			count+=1;
			yield;
		}
	}
}

task Stage5Unit25
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX,GetClipMinY-16,0,0,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX+80,GetClipMinY-16,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX-80,GetClipMinY-16,0,0,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX+140,GetClipMinY-16,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX-140,GetClipMinY-16,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX+60,GetClipMinY-16,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy08.txt",GetCenterX-60,GetClipMinY-16,0,0,1);
}

task Stage5Unit26
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+60,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+90,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+120,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-80,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-120,GetClipMinY-16,0,0,1);
}

task Stage5Unit27
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-60,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-90,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-120,GetClipMinY-16,0,0,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09a.txt",GetClipMinX,GetCenterY-130,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09a.txt",GetClipMinX,GetCenterY-80,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+80,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+120,GetClipMinY-16,0,0,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09a.txt",GetClipMaxX,GetCenterY-130,0,0,-1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09a.txt",GetClipMaxX,GetCenterY-80,0,0,-1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09a.txt",GetClipMaxX,GetCenterY-30,0,0,-1);
}

task Stage5Unit28
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+50,GetClipMinY-16,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-50,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+100,GetClipMinY-16,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-100,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+150,GetClipMinY-16,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-150,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09a.txt",GetClipMinX,GetCenterY-150,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09a.txt",GetClipMaxX,GetCenterY-150,0,0,-1);
	wait(15);
}

task Stage5Unit29
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-150,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-100,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-125,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-75,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-100,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-50,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-75,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-25,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-100,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-50,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-125,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX-75,GetClipMinY-16,1,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy10.txt",GetCenterX-120,GetClipMinY-32,1,90,1);
}

task Stage5Unit30
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+50,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,1,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+150,GetClipMinY-16,1,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+75,GetClipMinY-16,1,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+125,GetClipMinY-16,1,90,1);
}

task Stage5Unit31
{
let y=20;
	loop(8)
	{
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetClipMinX-16,GetClipMinY+0+y,1.0,15,1);
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetClipMinX-16,GetClipMinY-40+y,1.0,15,1);
		wait(45);
		y+=12;
	}
}

task Stage5Unit32
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetClipMaxX+24,GetCenterY,0.9,180,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetClipMaxX+24,GetCenterY-60,0.9,180,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetClipMaxX+24,GetCenterY,0.9,180,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetClipMaxX+24,GetCenterY-60,0.9,180,1);
}

task Stage5Unit33
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy10.txt",GetCenterX-80,GetClipMinY-32,1,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy10.txt",GetCenterX+0,GetClipMinY-32,1,90,1);
	wait(45);
//	CreateEnemyFromFile(csd~"stage5/Stage5Enemy10.txt",GetCenterX+80,GetClipMinY-32,1,90,1);
}

task Stage5Unit34
{
let y=310;
	loop(6)
	{
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetClipMaxX+16,GetClipMinY+0+y,1.0,180,1);
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetClipMaxX+16,GetClipMinY-40+y,1.0,180,1);
		wait(45);
		//y-=12;
	}
}

task Stage5Unit35
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+80,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+120,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+160,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+100,GetClipMinY-16,0,0,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+140,GetClipMinY-16,0,0,1);
}

task Stage5Unit36
{
	Unit;
	loop(4)
	{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetCenterX+0,GetClipMinY-16,1,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetCenterX+160,GetClipMinY-16,1,90,1);
	wait(45);
	}

	task Unit
	{
		wait(120);
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy10.txt",GetCenterX+80,GetClipMinY-32,1,90,1);
	}

}

task Stage5Unit37
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-160,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-130,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-100,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX+70,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-110,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-80,GetClipMinY-16,0,0,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy03.txt",GetCenterX-50,GetClipMinY-16,0,0,1);
}

task Stage5Unit38
{
let x=-90;
	loop(8)
	{
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02b.txt",GetClipMinX-60+x,GetClipMinY-16,1.0,60,1);
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02b.txt",GetClipMinX-10+x,GetClipMinY-16,1.0,60,1);
		wait(45);
		x+=45*cos(60);
	}
}

task Stage5Unit39
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+80,GetClipMinY-16,1.0,60,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+110,GetClipMinY-16,1.0,60,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+140,GetClipMinY-16,1.0,60,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+120,GetClipMinY-16,1.0,60,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+90,GetClipMinY-16,1.0,60,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+60,GetClipMinY-16,1.0,60,1);
}

task Stage5Unit40
{
	loop(10)
	{
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX+160,GetClipMinY-16,1.0,90,1);
		CreateEnemyFromFile(csd~"stage5/Stage5Enemy02a.txt",GetCenterX+110,GetClipMinY-16,1.0,90,1);
		wait(45);
	}
}

task Stage5Unit41
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-40,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-60,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-80,GetClipMinY-16,1.0,65,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-70,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-110,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-150,GetClipMinY-16,1.0,65,1);
}

task Stage5Unit42
{
	//CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);
	wait(60);
	//CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetCenterX+80,GetClipMinY-16,1.0,90,1);
	wait(210);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX-80,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX+80,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX+40,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX-40,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX-120,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX+20,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX-60,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09b.txt",GetCenterX-140,GetClipMinY-16,1.0,65,1);
}

task Stage5Unit43
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetCenterX-140,GetClipMinY-16,1.0,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetCenterX-40,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy11.txt",GetCenterX-100,GetClipMinY-16,1.0,90,1);
}

task Stage5Unit44
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-40,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+20,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+60,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+40,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+100,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+80,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+140,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+120,GetClipMinY-16,1.0,65,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+150,GetClipMinY-16,1.0,65,1);

	wait(30);

	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+130,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+70,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+30,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+50,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-10,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX+10,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-50,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-30,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-70,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy09.txt",GetCenterX-130,GetClipMinY-16,1.0,65,1);
}


task Stage5Unit45
{
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+100,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+110,GetClipMinY-16,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+80,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+100,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+120,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+70,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+90,GetClipMinY-16,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+110,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+130,GetClipMinY-16,1.0,65,1);
	wait(10);
}

task Stage5Unit46
{
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-100,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-110,GetClipMinY-16,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-80,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-100,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-120,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-70,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-90,GetClipMinY-16,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-110,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-130,GetClipMinY-16,1.0,65,1);
	wait(10);
}

task Stage5Unit47
{
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+100,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+110,GetClipMinY-16,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+80,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+100,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+120,GetClipMinY-16,1.0,65,1);
	wait(10);
}

task Stage5Unit48
{
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+80,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+70,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+90,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+100,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+80,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+60,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+50,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+70,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+90,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+110,1.0,65,1);
	wait(10);
}

task Stage5Unit49
{
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+80,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+70,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+90,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+100,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+80,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+60,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+50,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+70,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+90,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+110,1.0,65,1);
	wait(10);
}

task Stage5Unit50
{
loop(2)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+30,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+60,GetClipMinY-16,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+120,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+150,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+120,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+60,GetClipMinY-16,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+30,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+0,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-30,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-60,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-120,GetClipMinY-16,1.0,65,1);
	wait(10);

	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-150,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-120,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-90,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-60,GetClipMinY-16,1.0,65,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-30,GetClipMinY-16,1.0,65,1);
	wait(10);
}
	let waittime=5;
loop(2)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX,GetClipMinY-16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+50,GetClipMinY-16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+100,GetClipMinY-16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+150,GetClipMinY-16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+50,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+100,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+150,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+200,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+250,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+300,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+350,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMaxX+16,GetClipMinY+400,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+150,GetClipMaxY+16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+100,GetClipMaxY+16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+50,GetClipMaxY+16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+0,GetClipMaxY+16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-50,GetClipMaxY+16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-100,GetClipMaxY+16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-150,GetClipMaxY+16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX+0,GetClipMaxY+16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+400,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+350,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+300,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+250,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+200,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+150,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+100,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetClipMinX-16,GetClipMinY+50,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-150,GetClipMinY-16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-100,GetClipMinY-16,1.0,65,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Elemental.txt",GetCenterX-50,GetClipMinY-16,1.0,65,1);
	wait(waittime);
}

}

task Stage5Unit51
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-140,GetClipMinY-16,1.0,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-30,GetClipMinY-16,1.0,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+80,GetClipMinY-16,1.0,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+120,GetClipMinY-16,1.0,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+10,GetClipMinY-16,1.0,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-100,GetClipMinY-16,1.0,90,1);
}

task Stage5Unit52
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-140,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-100,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-60,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-120,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-140,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-100,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-60,GetClipMinY-16,1.0,90,1);
}


task Stage5Unit53
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+60,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+140,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+80,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+120,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+60,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,1.0,90,1);
	wait(10);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+140,GetClipMinY-16,1.0,90,1);
}

task Stage5Unit54
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy12.txt",GetClipMinX-16,GetClipMinY+50,1,130,1);
	wait(90);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy12.txt",GetClipMaxX+16,GetClipMinY+50,1,130,-1);
	wait(90);
}

task Stage5Unit55
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-60,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-120,GetClipMinY-16,1.0,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-140,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-20,GetClipMinY-16,1.0,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-60,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX-120,GetClipMinY-16,1.0,90,1);
	wait(30);
}

task Stage5Unit56
{
let waittime=20;
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+20,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+60,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+50,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+90,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+130,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+80,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+110,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+140,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+150,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+50,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+120,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+70,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+20,GetClipMinY-16,1.0,90,1);

	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+50,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+0,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-50,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+20,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-30,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-120,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-70,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-20,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-60,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-10,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+40,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+0,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+50,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+100,GetClipMinY-16,1.0,90,1);

	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+80,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+30,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-20,GetClipMinY-16,1.0,90,1);

	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+50,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+0,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-50,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX+20,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-30,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);

	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-10,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-60,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-110,GetClipMinY-16,1.0,90,1);

	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-30,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-130,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-50,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-100,GetClipMinY-16,1.0,90,1);
	wait(waittime);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy01.txt",GetCenterX-150,GetClipMinY-16,1.0,90,1);
}

task Stage5Unit57
{
	loop(4)
	{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+150,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+110,GetClipMinY-16,1.0,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+130,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+90,GetClipMinY-16,1.0,90,1);
	wait(45);
	}
}

task Stage5Unit58
{
	let y=205;
	loop(4)
	{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetClipMinX-16,GetCenterY-y,1.25,40,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetClipMinX-16,GetCenterY-y+50,1.25,40,1);
	wait(60);
	y-=45*sin(40);
	}
}


task Stage5Unit59
{
	loop(4)
	{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-50,GetClipMinY-16,1.0,90,1);
//	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-10,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+30,GetClipMinY-16,1.0,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-30,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+10,GetClipMinY-16,1.0,90,1);
	wait(45);
	}
}

task Stage5Unit60
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy13.txt",GetCenterX+120,GetClipMinY-16,1.0,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy13.txt",GetCenterX+40,GetClipMinY-16,1.0,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy13.txt",GetCenterX-40,GetClipMinY-16,1.0,90,1);
	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy13.txt",GetCenterX-120,GetClipMinY-16,1.0,90,1);
}

task Stage5Unit61
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+60,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+120,GetClipMinY-16,1.0,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+140,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+80,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+20,GetClipMinY-16,1.0,90,1);
	wait(60);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+60,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy04.txt",GetCenterX+120,GetClipMinY-16,1.0,90,1);
	wait(30);
}

task Stage5Unit62
{
loop(2)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-50,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-0,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+50,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX-100,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy02.txt",GetCenterX+100,GetClipMinY-16,1.0,90,1);
	wait(60);
}
}

task Stage5Unit63
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy13.txt",GetCenterX-135,GetClipMinY-16,1.0,90,1);
//	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy13.txt",GetCenterX-45,GetClipMinY-16,1.0,90,1);
	wait(45);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy13.txt",GetCenterX+45,GetClipMinY-16,1.0,90,1);
//	wait(30);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy13.txt",GetCenterX+135,GetClipMinY-16,1.0,90,1);
}

task Stage5Unit64
{

}

task Stage5Unit65
{
loop(6)
{
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX,GetClipMinY-16,1.0,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX+40,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX-40,GetClipMinY-16,1.0,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX+80,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX+120,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX-120,GetClipMinY-16,1.0,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX+160,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX-160,GetClipMinY-16,1.0,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX+120,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX-120,GetClipMinY-16,1.0,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX+80,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX-80,GetClipMinY-16,1.0,90,1);
	wait(15);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX+40,GetClipMinY-16,1.0,90,1);
	CreateEnemyFromFile(csd~"stage5/Stage5Enemy14.txt",GetCenterX-40,GetClipMinY-16,1.0,90,1);
	wait(15);
}
}