#e
#Title[ȁu~bhiCgZi[f-Hard-v]
#Text[G@Ĺu[~Av]
#ScriptVersion[2]
#PlayLevel[Hard]
#Player[FREE]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let name = "ȁu~bhiCgZi[f-Hard-v";

 @Initialize {
  CutIn(KOUMA, name, "", 0, 0, 0, 0);
  SetLife(7000);
  SetScore(1000000);
  SetX(GetClipMaxX);
  SetY(GetClipMaxY - 10);

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

  TMain;
 }

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

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 task TMain {
  yield;

  TShot;
  TShot2;

  loop {
   loop(1) { yield; }
   stundBy;
  }
 }

 sub stundBy {
  SetMovePosition02(GetClipMinX, GetClipMaxY - 10, 500);
  wait(500);
  SetMovePosition02(GetClipMaxX, GetClipMaxY - 10, 500);
  wait(500);
 }

 task TShot {
  yield;

  loop {
   loop(5) { yield; }
   SetShotColor(255, 180, 180);
   CreateShot01(GetX, GetY, rand(0.5, 2), -90, WHITE02, 0);
  }
 }

 task TShot2 {
  yield;

  loop {
   loop(5) { yield; }
   SetShotColor(255, 180, 180);
   CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMinY, rand(0.5, 1.5), 90, WHITE01, 0);
  }
 }

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

}