#e
#Title[ʏ5]
#Text[\˂̂悤ȃ[U[ʏUBPg\̃C[WB̂₷B]
#ScriptVersion[2]
#Player[FREE]

script_enemy_main {
        let count=-100;
	let cx=GetCenterX();//STGV[̒SxW擾
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
        let speed=0;

	@Initialize
	{
		SetLife(1500);//Ct1500ɐݒ
                SetDamageRate(50,50);
		SetTimer(70);//Ԑ70bɐݒ
		SetGraphicRect(1,1,64,64);//`挳`ݒ
		SetInvincibility(100);//G30t[Gɂ
		LoadGraphic(imgExRumia);//摜uimg\ExRumia.pngvǂ݂		
		SetMovePosition02(cx+0,80,160);//W(cx,60)160t[Ĉړ
		DeleteEnemyShot(ALL);//oƓɓGeSč폜
	}
	


	@MainLoop
	{
                if(count>200&&count%20==2)		
                {
                        let j=3;
                        while(j>1)
                        {
                            let angle = 90;
                            loop(4) {
                                     CreateLaser01(GetX, GetY,j+1, angle,80, 15, GREEN01, 0);
                                     CreateLaser01(GetX, GetY,j, 45-angle,50, 5, GREEN01, 0);
                                     angle += 90;
                                     }
                            j-=1
                        }
                 }

                if(count>240&&count%25==0)
		{
			let ang=GetAngleToPlayer();//G玩@ւ̊px擾
			let i=0;
			let h=0;
                        let g=1;
                        while(i<540)
			{
				CreateShot02(GetX(),GetY(),7,h+ang,-0.4,g+speed,GREEN03,1);//e𔭎
				CreateShot02(GetX(),GetY(),8,h+ang,-0.4,g-speed,GREEN02,1);
				i+=30;
                                h+=90;
                                g+=0.1;
			}

		}
		if(count==280)		
                {
                        let j=3;
                        while(j>1)
                        {
                            let angle = 90;
                            loop(90) {
                                     CreateShot01(GetX, GetY, j, angle, GREEN05, 0);
                                     angle += 4;
                                     }
                            j-=1
                        }
                 }
                if(count==320)
		{
			SetMovePositionRandom01(75,40,5,GetClipMinX()+100,80,GetClipMaxX()-100,150);
		}

		if(count==340){count=89;};
		SetCollisionA(GetX(),GetY(),32);//蔻(e)o^
		SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
		count++;
	}
	
	@Finalize
	{//ǂ݂񂾃t@C폜
		DeleteGraphic(imgExRumia);
	}
	
	@DrawLoop
	{//`
		SetColor(255,255,255);
		SetRenderState(ALPHA);
		SetTexture(imgExRumia);
		if(GetSpeedX()==0){SetGraphicRect(64,1,127,64);}
		else if(GetSpeedX()>0){SetGraphicRect(192,1,255,64);}
		else if(GetSpeedX()<0){SetGraphicRect(128,1,191,64);}
		DrawGraphic(GetX(),GetY());
	}
}
}