task Area1Stage1{
	bgmovX=0;
	bgmovY=0;
	StageInit;
	PlayMusic(ar1bgm1);
	CreateTimer(1670, GetCenterX-40, GetClipMinY);
	
	loop(100){yield;}
	CreateEnemyFromFile(GCSD~"Area1/Enemytalk.txt", GetClipMinX+50, GetClipMinY-30, 0, 0, 0);
	while(GetEnemyNum!=0){yield;}
	
	loop(100){yield;}
	loop(5){
		CreateEnemyFromFile(GCSD~"Area1/Enemy1.txt", GetClipMinX+50, GetClipMinY-30, 0, 0, 0);
		loop(20){yield;}
	}
	loop(5){
		CreateEnemyFromFile(GCSD~"Area1/Enemy1.txt", GetClipMinX+100, GetClipMinY-30, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy1.txt", GetClipMaxX-50, GetClipMinY-30, 0, 0, 0);
		loop(20){yield;}
	}
	loop(5){
		CreateEnemyFromFile(GCSD~"Area1/Enemy1.txt", GetCenterX+50, GetClipMinY-30, 0, 0, 0);
		loop(20){yield;}
	}
	loop(50){yield;}
	loop(3){
		CreateEnemyFromFile(GCSD~"Area1/Enemy2.txt", GetClipMinX-50, GetClipMinY+70, 0, 0, 0);
		loop(20){yield;}
	}
	loop(3){
		CreateEnemyFromFile(GCSD~"Area1/Enemy2.txt", GetClipMinX-50, GetClipMinY+50, 0, 0, 0);
		loop(20){yield;}
		CreateEnemyFromFile(GCSD~"Area1/Enemy2.txt", GetClipMaxX+50, GetClipMinY+70, 0, 0, 0);
		loop(20){yield;}
	}
	loop(3){
		CreateEnemyFromFile(GCSD~"Area1/Enemy2.txt", GetClipMaxX+50, GetClipMinY+50, 0, 0, 0);
		loop(20){yield;}
	}
	loop(50){yield;}
	ascent(i in 0..3){
		CreateEnemyFromFile(GCSD~"Area1/Enemy1.txt", GetClipMinX+50+i*100, GetClipMinY-30, 0, 0, 0);
		loop(20){yield;}
		CreateEnemyFromFile(GCSD~"Area1/Enemy2.txt", GetClipMaxX+50, GetClipMinY+50+i*20, 0, 0, 0);
		loop(20){yield;}
		CreateEnemyFromFile(GCSD~"Area1/Enemy1.txt", GetClipMaxX-50-i*100, GetClipMinY-30, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy2.txt", GetClipMinX-50, GetClipMinY+90-i*20, 0, 0, 0);
		loop(20){yield;}
	}
	loop(100){yield;}
	loop(6){
		CreateEnemyFromFile(GCSD~"Area1/Enemy3.txt", GetClipMaxX+50, GetClipMinY+60, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy3.txt", GetClipMinX-50, GetClipMinY+60, 0, 0, 0);
		loop(20){yield;}
	}
	loop(6){
		CreateEnemyFromFile(GCSD~"Area1/Enemy4.txt", GetClipMaxX+50, GetClipMinY+230, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy4.txt", GetClipMinX-50, GetClipMinY+230, 0, 0, 0);
		loop(20){yield;}
	}
	loop(100){yield;}
	ascent(i in 0..4){
		CreateEnemyFromFile(GCSD~"Area1/Enemy3.txt", GetClipMaxX+50, GetClipMinY+40+i*30, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy3.txt", GetClipMinX-50, GetClipMinY+40+i*30, 0, 0, 0);
		loop(20){yield;}
		CreateEnemyFromFile(GCSD~"Area1/Enemy4.txt", GetClipMaxX+50, GetClipMinY+230-i*20, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"Area1/Enemy4.txt", GetClipMinX-50, GetClipMinY+230-i*20, 0, 0, 0);
		loop(20){yield;}
	}
	loop(150){yield;}
	CreateEnemyBossFromFile(GCSD~"Area1/boss1.txt", GetCenterX, GetClipMinY-100, 0, 0, 0);
	loop(100){yield;}
	while(GetEnemyNum!=0){yield;}
	loop(100){yield;}
	StageClear;
}

sub Area1Stage1BG{

	sub Draw{
		bgmovX--;
		if(bgmovX<512){bgmovX+=512;}
		SetTexture(ar1bg1);
		SetGraphicRect(bgmovX, -bgmovX/2, 512+bgmovX, 512-bgmovX/2);
		SetGraphicScale(1.35, 1.35);
		SetGraphicAngle(90, 0, 0);
		SetAlpha(255);
		DrawGraphic3D(0, 0, 0);
		SetTexture(ar1bg2);
		SetGraphicRect(bgmovX, bgmovX/2, 512+bgmovX, 512+bgmovX/2);
		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;
}