
script_enemy_main
{    
   let imgEnemy="script\DanMUku\Stage5\Image\magikoopa.png";
   let count=0;
   let id=0;
   let x=GetX;
   @Initialize
   {            
		LoadUserShotData("script\DanMUku\MUtir\MUtir.txt");
            LoadGraphic(imgEnemy);
            SetLife(15);    
   }
   
   @MainLoop
   {
	if(count%16==0)
	{
		CreateShotA(id, GetX()+rand(-10,10), GetY()+rand(-10,10), 0);
		SetShotDataA(id, 0, 0.5, 90, 0, 0.03, 3, 147);
		FireShot(id);
		id+=1;
		CreateShotA(id, GetX()+rand(-10,10), GetY()+rand(-10,10), 5);
		SetShotDataA(id, 0, 0.5, 90, 0, 0.03, 3, 148);
		FireShot(id);
		id+=1;
		CreateShotA(id, GetX()+rand(-10,10), GetY()+rand(-10,10), 10);
		SetShotDataA(id, 0, 0.5, 90, 0, 0.03, 3, 149);
		FireShot(id);
		id+=1;

	}
      count++;
   }
   
   @Finalize
   {
      DeleteGraphic(imgEnemy);
   }
   
   @DrawLoop
   {
	if(x>GetX){
		SetGraphicAngle(0,0,0);
	}
	if(x<GetX){
		SetGraphicAngle(180,0,0);
	}
      x=GetX;
      SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetTexture(imgEnemy);
            SetGraphicRect(0,50,47,76);
            DrawGraphic(GetX,GetY);
   }
}
