#TouhouDanmakufu
#Title[Death Test]
#Text[You don't need to play this. It's boring]
#BackGround[User(.\img\Background.png,1,1)]
#BGM[.\bgm\AkyuSong.mp3]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{

let f = 0; 
	let f2 = 0;
	let f3 = 0;
	let f4 = 0;
	let slide = 0;
	let cut = GetCurrentScriptDirectory ~ "img\Cutin.png";
		let bg = GetCurrentScriptDirectory ~ "img\BG.png";
		let lay = GetCurrentScriptDirectory ~ "img\Lay.png";
		let imgBoss = GetCurrentScriptDirectory ~ "img\AkyuSprite.png";
		
	@Initialize{
	
	LoadGraphic(imgBoss);
		SetMovePosition01(GetCenterX, GetCenterY, 500);
		LoadGraphic(cut);
		LoadGraphic(bg);
		LoadGraphic(lay);
		SetLife(1);
		SetTimer(6);
		maintask;
	}

	@MainLoop{
		yield;
	}

	@DrawLoop{
	SetTexture(imgBoss);
		SetRenderState(ALPHA);
		SetAlpha(100);
	SetGraphicScale(1.25,1.25);
	if(f>=0 && f<5){SetGraphicRect(28,29,100,99);}
	if(f>=5 && f<10){SetGraphicRect(28,155,100,229);}
	if(f>=10 && f<20){SetGraphicRect(28,281,100,359);}
	f2 = 0;
	f++;
	if(f==20){
	f=0;
	f3 = 0;
	f4 = 0;
	}
	DrawGraphic(GetX,GetY);
	}

	@BackGround{
	SetTexture(bg);
		SetRenderState(ALPHA);
		SetAlpha(255);
		SetGraphicRect(0,0,774,1032);
		SetGraphicScale(0.5,0.5);
		SetGraphicAngle(0,0,0);
		DrawGraphic(GetCenterX,GetCenterY);
		
		SetTexture(lay);
		SetRenderState(ALPHA);
		SetAlpha(255);
		SetGraphicRect(0,0,10000+slide,10000+slide);
		SetGraphicScale(0.25,0.25);
		SetGraphicAngle(0,0,0);
		DrawGraphic(GetCenterX,GetCenterY);
	
		slide+=8;

	}

	@Finalize{
	DeleteGraphic(cut);
	DeleteGraphic(bg);

	}

	task maintask{
		fire;
		movement;

	}

	task movement{

	}

	task fire{
	DeleteEnemyShotInCircle(ALL,GetCenterX,GetCenterY,240);
	FadeOutMusic(GetCurrentScriptDirectory ~ "bgm\AkyuSong.mp3",300);
	Explosion01(GetEnemyX,GetEnemyY,100,200,300);
	MotionBlur(ALL,1000,105);
	Slow(7);
	PlaySE(GetCurrentScriptDirectory ~ "se\se_focus.wav");
	wait(100);
	Slow(0);
	DeleteGraphic(imgBoss);
	DeleteGraphic(cut);
	DeleteGraphic(bg);
	PlaySE(GetCurrentScriptDirectory ~ "se\se_enep01.wav");
	wait(180);
	}

	function wait(w){
		loop(w){yield;}
	}

}