script_enemy_main {
 let image = GetCurrentScriptDirectory ~ "enemies.png";
 let rotation = 0;
 let shot = GetCurrentScriptDirectory~"BulletWave.wav";
 let niceshot = GetCurrentScriptDirectory~"\Thaws_ShotSheet\shotdata.txt";
@Initialize{
    LoadUserShotData(niceshot);
    LoadSE(shot);
    SetLife(10);
    LoadGraphic(image);
    MainTask;
    MOVE;
    sound;
 }
  function Wait(t){loop(t){yield;}}
@MainLoop{
    rotation+=2;
   if(rotation>360){
   rotation=rotation-360;
   }
  yield;
 }
@DrawLoop{
   SetAlpha(255);
   SetTexture(image);
   SetGraphicRect(12,134,75,196);
   SetAlpha(220);
   SetGraphicScale(1,1);
   SetGraphicAngle(0,0,rotation);
   DrawGraphic(GetX,GetY);
 }
@Finalize{
   DeleteGraphic(image);
 }
 task MOVE{
  let a=0;
  let famAngle=GetArgument;
   loop{
     Wait(1);
    SetMovePosition01(GetEnemyX+70*cos(a+famAngle),GetEnemyY+70*sin(a+famAngle),1);
    a+=1;
   }
  }
 task MainTask{
   let a=0;
  loop{
    Wait(4);
    CreateShot01(GetX,GetY,2,a,1,0);
    a+=0.2;
    CreateShot01(GetX,GetY,2,a+1.5,2,2);
    a+=0.2;
    CreateShot01(GetX,GetY,2,a+3,3,4);
    a+=0.2;
    CreateShot01(GetX,GetY,2,a+4.5,4,6);
    a+=0.2;
    CreateShot01(GetX,GetY,2,a+6,5,8);
    a+=20.5;
   }
  }
  task sound{
    loop{    
    Wait(10);
    PlaySE(shot);
    }
  }
}
