
	#Title[zako1]
	#Text[zako]
	#ScriptVersion[2]
	
	script_enemy_main
	{
        let img = "script\ƒUƒR\zako4.PNG";
        let frame = 0;
let scoa=0;
      LoadCommonData;
		@Initialize
		{ 
              SetLife(2500);

              SetScore(0);
              SetTimer(60);
           SetEffectForZeroLife(0,0,0);

              LoadGraphic(img);
              SetTexture(img);  SetGraphicRect(0, 0, 64, 64);
             TMain;
		
		}
			
		@MainLoop
		{

    SetCollisionA(GetX, GetY, 24);
    SetCollisionB(GetX, GetY, 24);
   yield;


		}
		
		@DrawLoop
		{
		   DrawGraphic(GetX, GetY);
		}
			
		@Finalize
		{
if(scoa==0){
AddScore(500+500*GetPlayerLife);scoa=1;}
		}
         task TMain{
               yield;
                   move;
                    shot;


                  CreateEnemyFromScript("zako1", GetClipMinX, GetCenterY-150, 0, 0, 0);
        loop(45) { yield; }
                  CreateEnemyFromScript("zako1", GetClipMaxX, GetCenterY-90, 0, 0, 0);
        loop(45) { yield; }
                  CreateEnemyFromScript("zako1", GetClipMinX+45, GetCenterY-30, 0, 0, 0);
        loop(45) { yield; }
                  CreateEnemyFromScript("zako1", GetClipMaxX-45, GetCenterY+30, 0, 0, 0);
        loop(45) { yield; }

                    

                   }
         sub move{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetCenterX, GetClipMinY+60,30);



        loop(30) { yield; }
                  }
         task shot{ 
 loop(120) { yield; } 
 loop{   loop(3){
                   CreateShot02(GetX, GetY, 1, GetAngleToPlayer,0.1,5, BLUE03, 0);
                   CreateShot02(GetX, GetY, 5, GetAngleToPlayer+20,-0.05,3, PURPLE04, 0);
                   CreateShot02(GetX, GetY, 5, GetAngleToPlayer-20,-0.05,3, PURPLE04, 0);
                 loop(10) { yield; } 

        } loop(120) { yield; } 
       
                 }}
        sub nige{ 
              SetMovePosition02(GetX, GetClipMaxY, 180);
        loop(180) { yield; } 
             VanishEnemy;
                }
	}

	script_enemy  zako1
	{
        let img = "script\ƒUƒR\zako3.PNG";
        let frame = 0;

      LoadCommonData;
		@Initialize
		{ 
              SetLife(500);
              SetScore(0);
              LoadGraphic(img);
              SetTexture(img);  SetGraphicRect(0, 0, 64, 64);
             TMain;
		
		}
			
		@MainLoop
		{
    SetCollisionA(GetX, GetY, 24);
    SetCollisionB(GetX, GetY, 24);
   yield;


		}
		
		@DrawLoop
		{
		   DrawGraphic(GetX, GetY);
		}
			
		@Finalize
		{

		}
         task TMain{
               yield;
                   move;
                    shot;
                    

                   }
        task move{ 
loop{
if(GetX>GetCenterX){
     SetMovePosition02(GetClipMinX, GetY,300);

        loop(360) { yield; }}
else{
     SetMovePosition02(GetClipMaxX, GetY,300);
        loop(360) { yield; }}
}
                  }
                 task shot{  loop{ let a=rand(10,90);  loop(30){

                   CreateShot02(GetX, GetY, 3, 90+rand(-10,10),0,5, ORANGE05, 0);
  loop(1) { yield; } 
                   CreateShot02(GetX, GetY, 3, 90+rand(-10,10),0,5, RED05, 0);
  loop(1) { yield; } 
        }
        loop(90) { yield; } 
                 }}
        sub nige{ 
              SetMovePosition02(GetX, GetClipMaxY, 180);
        loop(180) { yield; } 
             VanishEnemy;
                }
	}
  
	script_enemy  zako2
	{
        let img = "script\ƒUƒR\zako3.PNG";
        let frame = 0;

      LoadCommonData;
		@Initialize
		{ 
              SetLife(500);
              SetScore(0);
              LoadGraphic(img);
              SetTexture(img);  SetGraphicRect(0, 0, 64, 64);
             TMain;
		
		}
			
		@MainLoop
		{
    SetCollisionA(GetX, GetY, 24);
    SetCollisionB(GetX, GetY, 24);
   yield;


		}
		
		@DrawLoop
		{
		   DrawGraphic(GetX, GetY);
		}
			
		@Finalize
		{

		}
         task TMain{
               yield;
                   move;
                    shot;
                    

                   }
         task move{ 
loop{
if(GetX>GetCenterX){
     SetMovePosition02(GetClipMinX, GetY,300);

        loop(360) { yield; }}
else{
     SetMovePosition02(GetClipMaxX, GetY,300);
        loop(360) { yield; }}
     }             }
         task shot{  loop{ let a=rand(10,90);  loop(30){

                   CreateShot02(GetX, GetY, 3, 270+rand(-10,10),0,5, ORANGE05, 0);
  loop(1) { yield; } 
                   CreateShot02(GetX, GetY, 3, 270+rand(-10,10),0,5, RED05, 0);
  loop(1) { yield; } 
        }
        loop(90) { yield; } 
                 }}
        sub nige{ 
              SetMovePosition02(GetX, GetClipMaxY, 180);
        loop(180) { yield; } 
             VanishEnemy;
                }
	}
  
