script_enemy_main
{
	let count      =3;
	let counta      =0;
	let couns      =0;
	let counsa     =0;
        let sp=0;
        let an=GetAngle;
	let imga=0;
	let imgEnemy=GetCurrentScriptDirectory~"img\kiri2.png";
	let imgAngle=0;
        let csd        = GetCurrentScriptDirectory;
        let shotData   = csd ~ "kshotData.txt";
        let tame         =csd~"se\shot10.wav";
	let cx=GetCenterX();  
	let cy=GetCenterY(); 

	let Angle=GetAngle;
	let pangle=0;
	@Initialize
	{
		SetLife(20);    //Ct1500ɐݒ
		SetGraphicRect(1,1,98,94);//`挳`ݒ	
		LoadUserShotData(shotData);
	}
	
	@MainLoop
	{



		if(counta==320)
		{
                  count=0;
		}
		if(count==2)
		{
                  count=0;
		}

		if(count==60)
		{
                let i=-100;
                loop(3){
                  i+=50;
                PlaySE(tame);
		CreateShotA(01,GetX,GetY,10);
		SetShotDataA(01,0,5,an+i,0,-0.2,-1,23);
                FireShot(01);
		CreateShotA(02,GetX,GetY,10);
		SetShotDataA(02,0,5,an+i,0,-0.2,1,23);
                FireShot(02);
		CreateShotA(03,GetX,GetY,10);
		SetShotDataA(03,0,5,an+i,0,-0.2,2,23);
		}
               }
		if(count==210)
		{
                loop(4){
                PlaySE(tame);
		CreateShotA(01,GetX,GetY,10);
		SetShotDataA(01,0,rand(6,2),rand(0,360),0,-0.2,0.5,43);
                FireShot(01);
		}
                let i=-100;
                loop(3){
                  i+=50;
                PlaySE(tame);
		CreateShotA(01,GetX,GetY,10);
		SetShotDataA(01,0,5,an+i,0,-0.2,-2,23);
                FireShot(01);
		CreateShotA(02,GetX,GetY,10);
		SetShotDataA(02,0,5,an+i,0,-0.2,1,23);
                FireShot(02);
		CreateShotA(03,GetX,GetY,10);
		SetShotDataA(03,0,5,an+i,0,-0.2,2,23);
		}
               }

              /////////////////////////////////////////////

		if(counsa==60)
		{
                  couns=60;
		}
		if(counsa==427)
		{
                  couns=427;
		}

		if(couns==0)
		{
                      sp+=0.1;
                  SetSpeed(5-sp);
                  couns=-1;
		}

		if(couns==300)
		{
	        imga+=2;
		SetColor(254-imga,254-imga,254-imga);
                  couns=299;
		}

		if(counsa==430)
		{
			VanishEnemy;
		}

               
              /////////////////////////////////              

		counta++;
		count++;
		couns++;
		counsa++;
	}

    // w t[҂
    function wait(w) {
        loop(w) { yield; }
}
	
	@DrawLoop
	{//`
		SetTexture(imgEnemy);
                SetGraphicScale(2,2);
		DrawGraphic(GetX(),GetY());
	}
	@Finalize
	{
			VanishEnemy;
	}
}