#e
#Title[_u񂳂-Easy-v]
#Text[ƂȂȂorz]
#ScriptVersion[2]
#PlayLevel[Easy]
#Player[FREE]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let name = "_u񂳂-Easy-v";
 let pet = 0;

 @Initialize {
  CutIn(KOUMA, name, "", 0, 0, 0, 0);
  SetX(GetCenterX);
  SetY(GetCenterY);
  SetLife(7000);
  SetScore(2000000);

  LoadGraphic(img);
  SetTexture(img);
  SetGraphicRect(64, 0, 128, 64);

  TMain;
 }

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

  pet += 1;
  if(pet == 200) {
   nway(0, 4, 60, WHITE03);
  }
  if(pet == 210) {
   nway(45, 4, 60, WHITE03);
  }
  if(pet == 220) {
   nway(90, 4, 60, WHITE03);
  }
  if(pet == 230) {
   nway(135, 4, 60, WHITE03);
  }
  if(pet == 240) {
   nway(180, 4, 60, WHITE03);
  }
  if(pet == 250) {
   nway(225, 4, 60, WHITE03);
  }
  if(pet == 260) {
   nway(270, 4, 60, WHITE03);
  }
  if(pet == 270) {
   nway(315, 4, 60, WHITE03);
  }
  if(pet == 280) {
   nway(360, 4, 60, WHITE03);
   pet = 0;
  }

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 task TMain {
  yield;

  TOne;
 }

 task TOne {
  yield;

  loop {
   loop(10) { yield; }
   CreateShot01(GetCenterX, GetClipMaxY, 1, -90, WHITE03, 0);
   wait(270);
  }
 }

 function wait(w) {
  loop(w) { yield; }
 }

 function nway(dir, way, span, color) {
  let mid = dir - (way - 1) / 2 * span;
  loop(way) {
   CreateShot01(GetX, GetY, 2.5, mid, color, 0);
   mid += span;
  }
 }

}