script_enemy_main{
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾
	let yosei101=GetCurrentScriptDirectory~"img\yosei1.png";
	let count2 = 0;
	let count3 = 0;
	let move = 0;
	let shootSE = GetCurrentScriptDirectory~".\SE\shoot13.wav";
	@Initialize
		{
		LoadGraphic(yosei101);
		SetTexture(yosei101);
		SetX(cx+50);
		SetY(1);
		SetScore(800);
		SetLife(400);//Ct50ɐݒ
		SetGraphicRect(1,1,32,32);//`挳`ݒ	
		SetMovePosition01(cx-100,60,6);
		
		}
	
		@MainLoop{
			SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
			SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
			count++;
			count2++;
			count3++;
			move++;

			if(count==40){
				let angle = 0;
				PlaySE(shootSE);
				loop(40){
					CreateShot01(GetX,GetY,2.5,GetAngleToPlayer+angle,RED02,0);
					angle += 9;
				}
				count=0;
			}

			if(count2==30){
				PlaySE(shootSE);
				CreateShot01(GetX,GetY,3,GetAngleToPlayer+15,RED01,0);
				CreateShot01(GetX,GetY,3,GetAngleToPlayer,RED01,0);
				CreateShot01(GetX,GetY,3,GetAngleToPlayer-15,RED01,0);
				count2=0;
			}

			if(count3==3){
				PlaySE(shootSE);
				CreateShot01(GetX,GetY,2,rand(0,360),RED01,0);
				count3=0;
			}
			
			if(move==600){
			SetMovePosition01(cx,-20,1);
			}

			if(GetY<-19){
				VanishEnemy();	
			}
		}
		@Finalize{
			if(GetX>-18){
			loop(20){
			CreateItem(ITEM_SCORE,GetX()+rand(-50,50),GetY()+rand(-50,50));}
			}
		}
		@DrawLoop
			{//`
			DrawGraphic(GetX(),GetY());
		}
}