#TouhouDanmakufu[Plural]
#ScriptVersion[3]
#Title["Amane Shin"]
#Text[""]
#Image[""]
#Background[""]
#BGM[""]
SetCommonData("dat",0);
let ss = GetCurrentScriptDirectory~"./Sounds/st.mp3";
let ss2 = GetCurrentScriptDirectory~"./Sounds/Last.mp3";
let objmusic = ObjSound_Create;
let objmusic2 = ObjSound_Create;

let bgam = GetCurrentScriptDirectory ~ "./Sounds/st.mp3" ;
let bgam2 = GetCurrentScriptDirectory ~ "./Sounds/Last.mp3" ;


let sbg = GetCurrentScriptDirectory ~ "bgg.jpg" ;
@Initialize{
	ObjSound_Load(objmusic,ss);
	ObjSound_Load(objmusic2,ss2);
	TPlural();
	LoadSound(bgam);
	LoadSound(bgam2);
	bak;
	}

	let vv=0;
	let hhh=0;
	
	task bak{
	
	
	
	
let bg1q=ObjPrim_Create(OBJ_SPRITE_2D);
bax(bg1q);
ObjPrim_SetTexture(bg1q,sbg);
ObjSprite2D_SetSourceRect(bg1q,0,0,1600,900);
ObjRender_SetAlpha(bg1q,255);
ObjSprite2D_SetDestCenter(bg1q);
ObjRender_SetPosition(bg1q,GetStgFrameWidth/2,230,0);
	
	
	
task bax(vv){

while(!Obj_IsDeleted(vv)){
yield;
ObjRender_SetAlpha(bg1q,255);

Obj_SetRenderPriorityI(bg1q,20);
ObjRender_SetAngleZ(vv,-hhh/2);
ObjRender_SetScaleXYZ(vv,0.7,0.7,0.7);
hhh+=0.1;
}
}


	
	
	
	}
	
	
	
	
	
@MainLoop{yield;}

@Finalize{}

task TPlural{
	let dir = GetCurrentScriptDirectory();
	
	SetCommonData("dat",0);
	let obj = ObjEnemyBossScene_Create();
	ObjEnemyBossScene_Add(obj, 0, dir ~ "Non1.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "Sp2.txt");
	
	ObjEnemyBossScene_Add(obj, 1, dir ~ "Non2.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "Sp1.txt");
	
	ObjEnemyBossScene_Add(obj, 2, dir ~ "Non3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "Sp3.txt");
	
	ObjEnemyBossScene_Add(obj, 3, dir ~ "Non4.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "Sp4.txt");
	
	ObjEnemyBossScene_Add(obj, 4, dir ~ "Non5.txt");
	ObjEnemyBossScene_Add(obj, 4, dir ~ "Sp5.txt");
	
	
			
			  ObjEnemyBossScene_Add(obj, 5, dir ~ "Sp6.txt");
			  
			  
			  
			  
			  
			  
	ObjEnemyBossScene_LoadInThread(obj);
	ObjEnemyBossScene_Regist(obj);
	
	while(!Obj_IsDeleted(obj)){
	
	PlayBGM(bgam,0,379);
	if(GetCommonData("dat",1)){yield;
	RemoveSound(bgam);yield;
	PlayBGM(bgam2,0,379);
	break;
	
	}
	
	
	
	yield;}

	while(!Obj_IsDeleted(obj)){yield;}
		
	CloseScript(GetOwnScriptID());}