script_enemy_main
{//Enemy01

	let cx=GetCenterX();//STGV[̒SxW擾
	let imgzako_kedama=GetCurrentScriptDirectory~"img\zako_kedama.png";
	let imgAngle=0;
	let i=rand_int(0,360);
	let count=i;
        let flame=0;


	@Initialize
	{
		LoadGraphic(imgzako_kedama);
		SetLife(20);//Ct1500ɐݒ
		SetGraphicRect(65,65,96,96);//`挳`ݒ	
		SetMovePosition02(cx+0,60,60);//W(cx,60)60t[Ĉړ
	}
	
	@MainLoop
	{

	SetMovePosition03(GetX+100,GetY-10,20,4);

	if(flame>40)
		{
			if(count%40==0)
			{
				let tAngle=0;
				
				CreateShot01(GetX(),GetY(),2,GetAngleToPlayer,GREEN01,0);



			}
		}
	if(count==360){count=0;}

		if(GetX>450)
		{
			VanishEnemy;
		}

		SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),12);//蔻(̓)o^
		count++;
		flame++;
	}
	
	@Finalize
	{//ǂ݂񂾃t@C폜
		if(GetX<420)
			{
			loop(2)
				{
				CreateItem(ITEM_SCORE,GetX+rand(-100,100),GetY+rand(20,100));
				}
			}
	}
	
	@DrawLoop
	{//`
		SetTexture(imgzako_kedama);

		SetGraphicAngle(0,0,-imgAngle);
		DrawGraphic(GetX(),GetY());

		imgAngle+=-15;
		if(imgAngle>360){imgAngle=0;}
	}

}