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(1){
                PlaySE(tame);
		CreateLaserA(01,GetX,GetY,0,10,03,0);
		SetLaserDataA(01,0,rand(an+10,an-10),0,1,0,0);
		SetLaserDataA(01,20,NULL,0,2,0,0);
		SetLaserDataA(01,30,NULL,0,4,0,0);
		SetLaserDataA(01,120,NULL,0,0,0,0);
		SetShotKillTime(01,170);
                FireShot(01);
		}
               }

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

		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;
	}
}