script_enemy_main
{    
    let imgEnemy="script\DanMUku\Stage6\Image\chauveH.png";
    let count=-30;
    let a=0;
    let b=32;
    let y = 0;
    let circle = [];
    let angle=1;
    let d = 0;
    let tir ="script\DanMUku\Stage1\Son\tir.wav";
    let x = GetX;


	function OnScreen() {
		return GetX>GetClipMinX&&GetX<GetClipMaxX&&GetY>GetClipMinY&&GetY<GetClipMaxY;
	}

   @Initialize
   {
      LoadUserShotData("script\DanMUku\MUtir\MUtir.txt");
      LoadGraphic(imgEnemy);
      LoadSE(tir);
            SetLife(100); 
   }
   
   @MainLoop
   {
          SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
if(count%10==0)
{
	if(a==99)
	{
		a=0;
		b=32;
	}
	else
	{
		a+=33;
		b+=33;
	}


}

if (count%40==0&&OnScreen) {
	PlaySE(tir);
	CreateShot02(GetX, GetY, 0, GetAngleToPlayer+10, 0.05, 5, 76, 5);
	CreateShot02(GetX, GetY, 0, GetAngleToPlayer-10, 0.05, 5, 76, 5);
}

count++;
yield;
   }
   @Finalize
   {
CreateItem(ITEM_SCORE, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
CreateItem(ITEM_SCORE, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
CreateItem(ITEM_SCORE, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
CreateItem(ITEM_SCORE, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
}
   
   @DrawLoop
   {

	if (x<GetX) {
		SetGraphicAngle(180, 0, 0);
	}
	else {
		SetGraphicAngle(0, 0, 0);
	}
	x = GetX;
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetTexture(imgEnemy);
            SetGraphicRect(a, 0, b, 21);
            DrawGraphic(GetX,GetY);
   }


}
