task Area1Stage2{
	bgmovX=0;
	bgmovY=0;
	StageInit;
	PlayMusic(ar1bgm1);
	CreateTimer(1670, GetCenterX-40, GetClipMinY);
	loop(100){yield;}
	ascent(i in 0..10){
		CreateEnemyFromFile(GCSD~"Area1/Enemy5.txt", GetClipMinX+i*20, GetClipMinY-10, 3, AngleToPlayer(GetClipMinX+i*20, GetClipMinY-10), 0);
		loop(10){yield;}
	}
	ascent(i in 0..10){
		CreateEnemyFromFile(GCSD~"Area1/Enemy5.txt", GetClipMaxX-i*20, GetClipMinY-10, 3, AngleToPlayer(GetClipMaxX-i*20, GetClipMinY-10), 0);
		loop(10){yield;}
	}
	ascent(i in 1..6){
		CreateEnemyFromFile(GCSD~"Area1/Enemy5.txt", GetClipMinX+i*20, GetClipMinY-10, 3, AngleToPlayer(GetClipMinX+i*20, GetClipMinY-10), 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy5.txt", GetClipMaxX-i*20, GetClipMinY-10, 3, AngleToPlayer(GetClipMaxX-i*20, GetClipMinY-10), 0);
		loop(10){yield;}
	}
	loop(50){yield;}
	loop(3){
		ascent(i in 0..3){
			CreateEnemyFromFile(GCSD~"Area1/Enemy6.txt", GetClipMinX+50+i*30, GetClipMinY-20, 3, 90, 0);
		}
		loop(20){yield;}
		ascent(i in 0..3){
			CreateEnemyFromFile(GCSD~"Area1/Enemy6.txt", GetClipMaxX-50-i*30, GetClipMinY-20, 3, 90, 0);
		}
		loop(20){yield;}
	}
	loop(2){
		CreateEnemyFromFile(GCSD~"Area1/Enemy7.txt", GetClipMinX, GetClipMinY, 0, 0, 0);
		loop(20){yield;}
		CreateEnemyFromFile(GCSD~"Area1/Enemy7.txt", GetClipMaxX, GetClipMinY, 0, 0, 0);
		loop(20){yield;}
	}
	loop(100){yield;}
	ascent(i in 1..6){
		CreateEnemyFromFile(GCSD~"Area1/Enemy5.txt", GetClipMinX+i*20, GetClipMinY-10, 3, AngleToPlayer(GetClipMinX+i*20, GetClipMinY-10), 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy5.txt", GetClipMaxX-i*20, GetClipMinY-10, 3, AngleToPlayer(GetClipMaxX-i*20, GetClipMinY-10), 0);
	}
	CreateEnemyFromFile(GCSD~"Area1/Enemy8.txt", GetClipMinX, GetClipMinY, 0, 0, 0);
	CreateEnemyFromFile(GCSD~"Area1/Enemy8.txt", GetClipMaxX, GetClipMinY, 0, 0, 0);
	loop(150){yield;}
	CreateEnemyFromFile(GCSD~"Area1/Enemy6.txt", GetClipMinX, GetClipMinY+40, 3, 0, 0);
	CreateEnemyFromFile(GCSD~"Area1/Enemy6.txt", GetClipMaxX, GetClipMinY+40, 3, 180, 0);
	CreateEnemyFromFile(GCSD~"Area1/Enemy8.txt", GetClipMinX+50, GetClipMinY, 0, 0, 0);
	CreateEnemyFromFile(GCSD~"Area1/Enemy8.txt", GetClipMaxX-50, GetClipMinY, 0, 0, 0);
	loop(150){yield;}
	CreateEnemyFromFile(GCSD~"Area1/Enemy8.txt", GetClipMinX+100, GetClipMinY, 0, 0, 0);
	CreateEnemyFromFile(GCSD~"Area1/Enemy8.txt", GetClipMaxX-100, GetClipMinY, 0, 0, 0);
	loop(2){
		CreateEnemyFromFile(GCSD~"Area1/Enemy7.txt", GetClipMinX, GetClipMinY, 0, 0, 0);
		loop(20){yield;}
		CreateEnemyFromFile(GCSD~"Area1/Enemy7.txt", GetClipMaxX, GetClipMinY, 0, 0, 0);
		loop(20){yield;}
	}
	loop(3){
		loop(150){yield;}
		CreateEnemyFromFile(GCSD~"Area1/Enemy8.txt", GetClipMinX+100, GetClipMinY, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy8.txt", GetClipMaxX-100, GetClipMinY, 0, 0, 0);
	}
	loop(150){yield;}
	CreateEnemyBossFromFile(GCSD~"Area1/boss2.txt", GetCenterX, GetClipMinY-100, 0, 0, 0);
	loop(100){yield;}
	while(GetEnemyNum!=0){yield;}
	loop(100){yield;}
	StageClear;
}

sub Area1Stage2BG{

	sub Draw{
		bgmovX--;
		if(bgmovX<512){bgmovX+=512;}
		SetTexture(ar1bg3);
		SetGraphicRect(bgmovX, 0, 512+bgmovX, 512);
		SetGraphicScale(1.35, 1.35);
		SetGraphicAngle(90, 0, 0);
		SetAlpha(255);
		DrawGraphic3D(0, 0, 0);
		SetTexture(ar1bg4);
		SetGraphicRect(bgmovX, 0, 512+bgmovX, 512);
		SetGraphicScale(1.35, 1.35);
		SetGraphicAngle(90, 0, 0);
		SetAlpha(255);
		DrawGraphic3D(0, 0, 0);
	}
	
	BackdropColor = [0, 0, 0];
	FogColor = [255, 255, 255];
	FogMin = 0;
	FogMax = 10000;
	CamX = 0;
	CamY = 0;
	CamZ = 0;
	CamDist = 400;
	CamRot = 0;
	CamLift = 50;
	Draw;
}