#e
#Title[̕sũ[-Easy-v]
#Text[G@Lubʂv]
#ScriptVersion[2]
#PlayLevel[Easy]
#Player[FREE]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let name = "̕sũ[-Easy-v";

 @Initialize {
  CutIn(KOUMA, name, "", 0, 0, 0, 0);
  SetX(GetClipMaxX);
  SetY(GetClipMinY + 60);
  SetLife(7000);
  SetScore(1000000);
  SetTimer(99);

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

  TMain;
 }

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

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 task TMain {
  yield;

  TMove;
 }

 task TMove {
  yield;

  TShot;
  TShot2;

  loop {
   loop(1) { yield; }
   SetMovePosition02(GetClipMinX, GetClipMinY + 60, 120);

   wait(120);
   SetMovePosition02(GetPlayerX, GetPlayerY + 45, 0);

   wait(60);
   SetMovePosition02(GetClipMaxX, GetClipMinY + 60, 0);
  }
 }

 task TShot {
  yield;

  loop {
   loop(30) { yield; }
   CreateShot01(GetX, GetY, rand(0.5, 1), rand(0, 180), YELLOW11, 0);
   CreateShot01(GetX, GetY, rand(0.5, 1), rand(0, 180), YELLOW11, 0);
   CreateShot01(GetX, GetY, rand(0.5, 1), rand(0, 180), YELLOW11, 0);
   CreateShot01(GetX, GetY, rand(0.5, 1), rand(0, 180), YELLOW11, 0);
   CreateShot01(GetX, GetY, rand(0.5, 1), rand(0, 180), YELLOW11, 0);
  }
 }

 task TShot2 {
  yield;

  loop {
   loop(121) { yield; }
   CreateShot01(GetX, GetY, 3, -30, BLUE01, 0);
   CreateShot01(GetX, GetY, 3, -150, BLUE01, 0);
   CreateShot01(GetX, GetY, 2, -45, RED01, 0);
   CreateShot01(GetX, GetY, 2, -135, RED01, 0);
   CreateShot01(GetX, GetY, 1, -90, PURPLE01, 0);
   loop(60) { yield; }
  }
 }

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

}