
script_enemy_main
{
	let count=0;
	let count2=0;
	let cx=GetCenterX();
	let img=GetCurrentScriptDirectory~"img\dot-kaze-ti2.png";
	let sh00=GetCurrentScriptDirectory~"\se\Shot00.wav";
	let sh01=GetCurrentScriptDirectory~"\se\Shot01.wav";
	LoadUserShotData(GetCurrentScriptDirectory~".\shot_All.txt");
	let ang=0;
	@Initialize
	{
		SetLife(2550);
		SetTimer(37);
		SetDamageRate(100,70);
		SetInvincibility(150);
		SetNormPoint(-1);
		LoadGraphic(img);
		SetShotAutoDeleteClip(8,8,8,8);
		SetMovePosition02(cx,126,60);

	}

	@MainLoop
	{
		if (count==20) {
			SetColor(128,0,255);
			Concentration01(105);
			PlaySE(GetCurrentScriptDirectory~"\se\push02.wav");
		}
		if (count>=100&&count%3==0) {
			PlaySE(sh00);
			ascent(let t in 0..12) {
				CreateShot02(GetX()-1,GetY()-7,7.4,15-count+40*sin(count*count*5)+t*30-count/6,-0.1,2.7,135,0);
				CreateShot02(GetX()-1,GetY()-7,7.4,15+count+40*sin(count*count*5+180)+t*30+count/8,-0.1,2.7,134,0);
			}
		}
		SetCollisionA(GetX(),GetY(),38);
		SetCollisionB(GetX(),GetY(),24);
		count++;
		count2++;
	}

	@Finalize
	{
		DeleteGraphic(img);
		SetShotAutoDeleteClip(32,32,32,32);
		loop(40)
		{
			CreateItem(ITEM_SCORE,GetX()+rand(-65,65),GetY()+rand(-20,60));
		}
		CreateItem(ITEM_1UP,GetX(),GetY()+20);SetShotAutoDeleteClip(32,32,32,32);

	}

	@DrawLoop
	{
		SetTexture(img);
		SetAlpha(255);
		SetColor(255,255,255);
		SetRenderState(ALPHA);
		SetGraphicScale(1,1);
		if (GetSpeed()<0.1) {
			SetGraphicRect(128,64,192,128);
		}
		if (GetSpeed()>=0.1||count>0) {
			if (count2%3==0) {
				SetGraphicRect(0,128,128,256);
			}
			if (count2%3==1) {
				SetGraphicRect(0,256,128,384);
			}
			if (count2%3==2) {
				SetGraphicRect(0,384,128,512);
			}
		}
		DrawGraphic(GetX(),GetY());
	}
}
