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

              SetTimer(30);
           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;
                   CreateEnemyFromScript("zako1", GetX, GetY, 0, 0, 0);
                   CreateEnemyFromScript("zako2", GetX, GetY, 0, 0, 0);
                   CreateEnemyFromScript("zako3", GetX, GetY, 0, 0, 0);
                   CreateEnemyFromScript("zako4", GetX, GetY, 0, 0, 0);
                    shot;
                    

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



        loop(30) { yield; }
                  }
         task shot{  loop{   loop(1){
                   CreateShot02(GetX, GetY, 1, GetAngleToPlayer,0.1,5, BLUE03, 20);
                   CreateShot02(GetX, GetY, 7, GetAngleToPlayer+20,-0.1,3, AQUA02, 20);
                   CreateShot02(GetX, GetY, 7, GetAngleToPlayer-20,-0.1,3, AQUA02, 20);
                   CreateShot02(GetX, GetY, 7, GetAngleToPlayer+40,-0.1,3, AQUA02, 20);
                   CreateShot02(GetX, GetY, 7, GetAngleToPlayer-40,-0.1,3, AQUA02, 20);

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

	script_enemy  zako1
	{
        let img = "script\ザコ\zako3.PNG";
        let frame = 0;

      LoadCommonData;
		@Initialize
		{ 
              SetLife(250);
              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;
                    

                   }
         sub move{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetCenterX+90, GetClipMinY+120,30);
        loop(30) { yield; }
                  }
         task shot{  loop{ let a=rand(10,90);  loop(5){

CreateShotA(11,GetX,GetY,0);
SetShotDataA(11,0,4,90,0,0,9,RED21);
SetShotDataA(11,a,4,180,0,0,9,RED21);
FireShot(11);
  loop(5) { yield; } 
        }
        loop(60) { yield; } 
                 }}
        sub nige{ 
              SetMovePosition02(GetX, GetClipMaxY, 180);
        loop(180) { yield; } 
             VanishEnemy;
                }
	}
  
	script_enemy  zako2
	{
        let img = "script\ザコ\zako3.PNG";
        let frame = 0;

      LoadCommonData;
		@Initialize
		{ 
              SetLife(250);
              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;
                    

                   }
         sub move{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetCenterX-90, GetClipMinY+120,30);
        loop(30) { yield; }
                  }
         task shot{  loop{ let a=rand(10,90);  loop(5){

CreateShotA(11,GetX,GetY,0);
SetShotDataA(11,0,4,90,0,0,9,RED21);
SetShotDataA(11,a,4,0,0,0,9,RED21);
FireShot(11);
  loop(5) { yield; } 
        }
        loop(60) { yield; } 
                 }}
        sub nige{ 
              SetMovePosition02(GetX, GetClipMaxY, 180);
        loop(180) { yield; } 
             VanishEnemy;
                }
	}
  
	script_enemy  zako3
	{
        let img = "script\ザコ\zako3.PNG";
        let frame = 0;

      LoadCommonData;
		@Initialize
		{ 
              SetLife(250);
              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;
                    

                   }
         sub move{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetCenterX+120, GetClipMinY+60,30);
        loop(30) { yield; }
                  }
         task shot{  loop{ let a=rand(10,90);  loop(5){

CreateShotA(11,GetX,GetY,0);
SetShotDataA(11,0,4,90,0,0,9,RED21);
SetShotDataA(11,a,4,180,0,0,9,RED21);
FireShot(11);
  loop(5) { yield; } 
        }
        loop(60) { yield; } 
                 }}
        sub nige{ 
              SetMovePosition02(GetX, GetClipMaxY, 180);
        loop(180) { yield; } 
             VanishEnemy;
                }
	}
  
	script_enemy  zako4
	{
        let img = "script\ザコ\zako3.PNG";
        let frame = 0;

      LoadCommonData;
		@Initialize
		{ 
              SetLife(250);
              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;
                    

                   }
         sub move{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetCenterX-120, GetClipMinY+60,30);
        loop(30) { yield; }
                  }
         task shot{  loop{ let a=rand(10,90);  loop(5){

CreateShotA(11,GetX,GetY,0);
SetShotDataA(11,0,4,90,0,0,9,RED21);
SetShotDataA(11,a,4,0,0,0,9,RED21);
FireShot(11);
  loop(5) { yield; } 
        }
        loop(60) { yield; } 
                 }}
        sub nige{ 
              SetMovePosition02(GetX, GetClipMaxY, 180);
        loop(180) { yield; } 
             VanishEnemy;
                }
	}
  
