script_enemy_main {
 let enemy = GetCurrentScriptDirectory~"img\hyousei2.png";
 let pet = 0;
 let angle = rand(0, 360);
 let row = 0;

 @Initialize {
  SetLife(500);
  SetInvincibility(30);

  LoadGraphic(enemy);
  SetTexture(enemy);
  SetGraphicRect(0, 0, 32, 32);
 }

 @MainLoop {
  SetCollisionA(GetX, GetY, 24);
  SetCollisionB(GetX, GetY, 16);

  pet += 1;
  if(pet == 30) {
   loop(30) {
    CreateShot01(GetX, GetY, 2, angle + row, BLUE01, 10);
    angle += 42.9;
   }
   row += rand(1, 13);
   pet = 0;
  }

 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  loop(10) {
   CreateItem(ITEM_SCORE, rand(GetClipMinX + 30, GetClipMaxX - 30), rand(GetCenterY - 120, GetCenterY));
  }
 }

}