script_enemy_main
{    
    let imgEnemy="script\DanMUku\Stage5\Image\maskass.png";
    let count=-50;
    let tir ="script\DanMUku\Stage1\Son\tir.wav";
    let munch ="script\DanMUku\Stage1\Son\muncher.wav";

   @Initialize
   {
	  LoadUserShotData("script\DanMUku\MUtir\MUtir.txt");
      LoadGraphic(imgEnemy);
      LoadSE(tir);
	  LoadSE(munch);
            SetLife(150); 
	
   }

   
   @MainLoop
   {
          SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	if (count==-50) {
		CreateLaserA(1, GetX, GetY, 500, 10, 1, 50);
		SetLaserDataA(1,0,GetAngle(), 0,0,0,0);
		SetShotKillTime(1, 50);
		FireShot(1);
	}
	if (count==0) {
		SetSpeed(5);
	}
	if (count>10 && ( GetX<GetClipMinX || GetY<GetClipMinY || GetX>GetClipMaxX || GetY>GetClipMaxY  ) ){
		SetLife(0);
	}
	count++;
	yield;
   }
   @Finalize
   {
	let l;
	let angle=0;
	loop(48)
	{
		l=rand(0, 360/24);
		PlaySE(tir);
		CreateShot01(GetX, GetY, 3, angle, rand(37,51), 10);
		angle+=l;
	}
loop(8)
{
CreateItem(ITEM_SCORE, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
}
}
   
   @DrawLoop
   {
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetTexture(imgEnemy);
            SetGraphicRect(47, 89, 105, 123);
	    SetGraphicAngle(0, 0, GetAngle);
            DrawGraphic(GetX,GetY);
   }

}
