//ėp

function RealToIntString(let num){
   if(num<0){num=0;}
   let stringarray=["0","1","2","3","4","5","6","7","8","9"];
   let lp=floor(log10(num))+1;
   let lp1=lp;
   if(lp<=0){result="0"}
   else{
      result = "";
      loop(lp){
         result=result~ stringarray[(num%(10^lp1)-num%(10^(lp1-1)))/(10^(lp1-1))];
         lp1--;
      }
   }
}

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


task Tclear{
	clear=true;
   wait(200);
	if(GetCommonData("ex")==1){
      while(GetPlayerLife>1){
         ExtendPlayer(-1);
         AddScore(10000);
         PlaySE("se1UP.wav");
         wait(60);
      }
      while(GetPlayerBomb>0){
         AddBomb(-1);
         AddScore(2000);
         PlaySE("se1UP.wav");
         wait(60);
      }
      wait(120);
      Clear;
	}
	else{
		SetCommonData("ex",1);
		time=0;
	}
	clear=false;
}

task Tzako1_1(let w,let n,let rank){//t^[
   let a=time;
   loop(n){
      CreateEnemyFromFile( zako1, 224-cos(a*110)*150, 0, rank, 0, 1);
      wait(w);
      a++;
   }
}
task Tzako1_2(let r,let rank){//SC
   let a=0;
   loop(4){
      CreateEnemyFromFile( zako1, 224-(130-a*35)*r, 0, rank, 0, 2);
      wait(20);
      a++;
   }
}
task Tzako1_3(let r,let w,let n,let rank){//E҂傱҂傱
   let a=time;
   loop(n){
      CreateEnemyFromFile( zako1, 224-245*r-cos(a*71)*20, 170-cos(a*110)*30, rank, 0, 3);
      wait(w);
      a++;
   }
}