#東方弾幕風
#Title[クルクル〜]
#Text[]
#ScriptVersion[2]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let name = "クルクルクルクル";

 @Initialize {
  CutIn(KOUMA, name, "", 0, 0, 0, 0);
  SetX(GetCenterX);
  SetY(GetCenterY - 120);
  SetLife(5000);
  SetScore(1000000);
  SetTimer(99);

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

  TMain;
 }

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

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 //以下タスク(マイクロスレッド)

 task TMain {
  yield;

  TMove;
  TShot;
  TShot2; //何個足してもおｋ
 }

 task TMove {
  yield;
 }

 task TShot {
  let angle = 0;
  yield;

  loop {
   loop(5) { yield; }
   CreateShot01(GetX - 60, GetY, 1, angle, RED11, 5);
   angle += 16.5;
  }
 }

 task TShot2 {
  let angle = 0;
  yield;

  loop {
   loop(5) { yield; }
   CreateShot01(GetX + 60, GetY, 1, angle, BLUE11, 5);
   angle -= 11.5;
  }
 }

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

}