#東方弾幕風[Player]
#Menu[紅城　零 (ｱｶｷﾞ ｼｽﾞｸ)]
#Text[高速Z　バスター
低速Z　セイバー
X　（＋他のキーで）必殺技
C　バスター、セイバー入れ替え
シフト二連打 ボム

STGなのに剣で戦う無謀人。
セイバーは正面だけでなく、横も攻撃可能。おまけに高威力。
必殺技はエネルギーを消費しない上、武器変更を行う必要も無い。
強力だが移動速度変更時にチャージが中断される弱点有り。

]
#Image[.\零セレクト.PNG]
#ReplayName[ZERO2]


	script_player_main
	{
	let current = GetCurrentScriptDirectory();
	let imgZERO = current~"零ドット.PNG";
	let imgZEROCutIn = current~"零セレクト.png ";
	let gezi = current~"ゲージ.png ";
	let shotCount = -1;
	let bNextShot = false;
	let objShot = NULL;
	let objShot1 = NULL;
        let objShot2 = NULL;
        let objShot3 = NULL;
        let objlase = NULL; 
        let angle=40;
        let lee=150;
        let L=10;
        let L2=10;
        let A=16;
        let B=100;
        let RC=0;
let ha=0;
let LV=0;
        let CB=0;
       let OR=1;
       let cha=0;
       let cha2=0;
       let bki=0;
       let zan=0;
       let dot=1;
let po=0;
       let dot2=dot-1;
let gokusi=49;
CreateCommonDataArea("gokusi");
  let buki=GetCurrentScriptDirectory~"\PLAYER\ゼロ\アイテムST.txt";
       let myu=50;
       let ST=51;
       let FA=52;
       let IC=53;
       let BM=54;
       let EL=55;
       let CM=56;
       let OC=57;
       let AM=58;
SetCommonDataEx("gokusi",ST,1);
SetCommonDataEx("gokusi",FA,1);
SetCommonDataEx("gokusi",IC,1);
SetCommonDataEx("gokusi",BM,1);
SetCommonDataEx("gokusi",EL,1);
SetCommonDataEx("gokusi",CM,1);
SetCommonDataEx("gokusi",OC,1);
SetCommonDataEx("gokusi",AM,1);
SetCommonDataEx("gokusi",myu,2);
#include_function".\風陣剣.txt"
#include_function".\延刃突.txt"
#include_function".\光絶閃.txt"
#include_function".\飛月.txt"
#include_function".\紅炎撃.txt"
#include_function".\氷連突.txt"

sub cc{         Obj_SetX(objShot2, GetPlayerX);
		Obj_SetY(objShot2, GetPlayerY);
                 if(cha>=1){
                if(!Obj_BeDeleted(objShot2)){return;}
                objShot2 = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot2, GetPlayerX);
		Obj_SetY(objShot2, GetPlayerY);
		Obj_SetSpeed(objShot2, 0);
                Obj_SetAlpha(objShot2,74);
		ObjShot_SetGraphic(objShot2,8);
		ObjShot_SetDamage(objShot2, 0);
		ObjShot_SetPenetration(objShot2, 500);	
		Obj_SetAngle(objShot2, 270);}

                if(cha<=1){Obj_Delete(objShot2);}
}
sub cc2{         Obj_SetX(objShot3, GetPlayerX);
		Obj_SetY(objShot3, GetPlayerY);
                 if(cha2>=2){
                if(!Obj_BeDeleted(objShot3)){return;}
                objShot3 = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot3, GetPlayerX);
		Obj_SetY(objShot3, GetPlayerY);
		Obj_SetSpeed(objShot3, 0);
               Obj_SetAlpha(objShot3,74);
		ObjShot_SetGraphic(objShot3,11);
		ObjShot_SetDamage(objShot3, 0);
		ObjShot_SetPenetration(objShot3, 500);	
		Obj_SetAngle(objShot3, 270);}

                if(cha2<=1){Obj_Delete(objShot3);}
}

        task laa{     
                                   
                        objlase = Obj_Create(OBJ_LASER);                        
                        Obj_SetX(objlase, GetPlayerX);
		        Obj_SetY(objlase, GetPlayerY-10);  
		        Obj_SetSpeed(objlase, 20);
		        ObjShot_SetGraphic(objlase, 4);
                        Obj_SetAngle(objlase,angle);
                        ObjLaser_SetLength(objlase,lee);
                        ObjLaser_SetWidth(objlase,15);
                        ObjShot_SetDamage(objlase,1);
                        ObjLaser_SetSource(objlase,false);                         
                   loop(5){    yield;}
                        Obj_Delete(objlase); 
                            
                 }
        task hom()
        	{
                if(!Obj_BeDeleted(objShot)){return;}
                objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-30);
		Obj_SetSpeed(objShot, 15);
		ObjShot_SetGraphic(objShot, 2);
		ObjShot_SetDamage(objShot, 15);
		ObjShot_SetPenetration(objShot, 1);
		while( !Obj_BeDeleted(objShot) )
		{	let toAngle=atan2(GetEnemyY()-Obj_GetY(objShot), GetEnemyX()-Obj_GetX(objShot));
               if(GetEnemyNum == 0)
              { toAngle = 270;  }		
			Obj_SetAngle(objShot, toAngle);

			yield;
		}


}
task bom{
SetTexture(gezi);
LoadGraphic(gezi);
SetGraphicRect(0,0,GetPlayerBomb*2,64);
SetColor(255,255,255);
SetAlpha(120);

DrawGraphic(215+GetPlayerBomb,450);


}
task ani{
loop(3){dot=2;yield;ha=1;}
loop(2){dot=3;yield;ha=1;}
loop(9){dot=4;yield;ha=1;}
dot=1;ha=0;
}
task ani2{
loop(20){dot=5;yield;ha=1;}
dot=1;ha=0;
}

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




		
		@Initialize
		{
		SetPlayerLifeImage(imgZERO, 197, 1, 270, 86);	
                LoadGraphic(imgZERO);
		SetSpeed(4, 2.5);
                SetRebirthFrame(0);
                SetInitialBombCount(B);
		LoadPlayerShotData(current~"0ショット.txt");
		SetItemCollectLine(160);
               LoadSE("\koukaonn\tama1.wav");
               LoadSE("\koukaonn\tama2.wav");
               LoadSE("\koukaonn\se03.wav");
               LoadSE("\koukaonn\se04.wav");
               LoadSE("\koukaonn\reflect.wav");
              LoadSE("\koukaonn\pattern01.wav");
                   LoadSE("\koukaonn\sword2.wav");
               LoadSE("\koukaonn\bigshot1.wav");
        LoadSE("\koukaonn\se012-0088.wav");
		}
		
		@MainLoop
		{	     RC=0;           	if(OnEvent()==true){SetSpeed(0, 0);break;}else{SetSpeed(3.5, 2);}   cc; cc2;
		if(GetKeyState(VK_USER)==KEY_PUSH){OR=OR+1;
            PlaySE("\koukaonn\se012-0088.wav");
if(OR>1){OR=0;}}

LV=GetCommonDataEx("gokusi",ST)+GetCommonDataEx("gokusi",FA)+GetCommonDataEx("gokusi",CM)+GetCommonDataEx("gokusi",OC)+GetCommonDataEx("gokusi",BM)+GetCommonDataEx("gokusi",IC)+GetCommonDataEx("gokusi",EL)+GetCommonDataEx("gokusi",AM);
if(LV>8){LV=8;}	
CB=CB-1;
if(CB<0){CB=0;}
if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_PULL){cha2=0;cha=0;	}
if(GetGraze>4){AddGraze(-1*GetGraze);AddBomb(1);}
if(GetPlayerBomb==0){AddBomb(1);}
if(GetPlayerBomb>40+15*truncate(LV/2)){AddBomb(40+15*truncate(LV/2)-GetPlayerBomb);}	
if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH){if(CB==0){CB=15;}else{if(GetCommonDataEx("gokusi",OC)>0){if(GetPlayerBomb>=30){UseSpellCard("hikari", true);AddBomb(-30);}}
if(GetCommonDataEx("gokusi",OC)<1){if(GetPlayerBomb>=30){
ani;PlaySE("\koukaonn\sword2.wav");UseSpellCard("ZAN", true);zan=0;AddBomb(-30);}}

}}
if(OnBomb==false){po=GetScore;}
else{AddScore(-1*GetScore+po);}
		//毎フレーム実行される部分です
		//
		if((GetKeyState(VK_SHOT)==KEY_PUSH || GetKeyState(VK_SHOT)==KEY_HOLD || bNextShot==true) && shotCount==-1)
		{       
			shotCount = 0;
			bNextShot = false;
		}
		if(GetKeyState(VK_SHOT)==KEY_HOLD && shotCount>0)
		{
			bNextShot = true;
		}
		if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
if(OR==0){
         if(GetKeyState(VK_SHOT)==KEY_HOLD){cha=cha+1/40;if(cha==2){cha=2;}}  
  if(GetKeyState(VK_SHOT)==KEY_PULL){  
 task bas1{loop(1){objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-50);
		Obj_SetSpeed(objShot, 19);
		ObjShot_SetGraphic(objShot, 5);
		ObjShot_SetDamage(objShot, 100);
		ObjShot_SetPenetration(objShot, 1);
                Obj_SetAngle(objShot, 270);PlaySE("\koukaonn\se04.wav");loop(20){yield;}}}
task bas2{loop(2){objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-50);
		Obj_SetSpeed(objShot, 19);
		ObjShot_SetGraphic(objShot, 5);
		ObjShot_SetDamage(objShot, 125);
		ObjShot_SetPenetration(objShot, 1);
                Obj_SetAngle(objShot, 270);PlaySE("\koukaonn\se04.wav");loop(15){yield;}}

   }if(cha>1){if(cha>=2){ani2;  bas2;}else{ani2;bas1;}cha=0;}
}}
else{
   if(GetKeyState(VK_SHOT)==KEY_HOLD) {if(GetCommonDataEx("gokusi",AM)>0){cha2=cha2+1/150;}}
if(GetKeyState(VK_SHOT)==KEY_PULL) { if(cha2>=2){ani;PlaySE("\koukaonn\sword2.wav");UseSpellCard("ZAN", true);zan=0;}cha2=0;}
}
         if(GetKeyState(VK_SHOT)==KEY_PUSH )	
			{	
if(OR==0){
			       ani2; PlaySE("\koukaonn\tama1.wav");CreatePlayerShot01(GetPlayerX, GetPlayerY-50, 15, 270, 20, 1, 2); cha=0;}

if(OR==1){
task sai{
                  angle=340;
             lee=225;
             L=-10;
             A=14;
    if(GetKeyState(VK_LEFT)==KEY_HOLD ){angle=225; L=+10; A=18;}
    if(GetKeyState(VK_RIGHT)==KEY_HOLD ){angle=295; L=-10; A=18;} 
                     
       bki=1;

                objlase = Obj_Create(OBJ_LASER); 
	        Obj_SetX(objlase, GetPlayerX);
		Obj_SetY(objlase, GetPlayerY-10); 
                Obj_SetAngle(objlase,angle);
	        Obj_SetSpeed(objlase, 20);
                ObjShot_SetGraphic(objlase, 4);
                ObjLaser_SetWidth(objlase,30);
                ObjShot_SetDamage(objlase,40);
                ObjLaser_SetSource(objlase,false);     

             loop(A){ 

                  if(GetCommonDataEx("gokusi",BM)>0){CreatePlayerShot01(Obj_GetX(objlase), Obj_GetY(objlase), 20, angle, 5, 1, 1);} 
                  ObjLaser_SetLength(objlase,lee);            
                  Obj_SetAngle(objlase,angle);
                  angle=angle+L;  
	        Obj_SetX(objlase, GetPlayerX);
		Obj_SetY(objlase, GetPlayerY-10);      
                              
               yield;     
               } 
  Obj_Delete(objlase);  

bki=0;
                 
                  }

   if(bki==0&&GetKeyState(VK_BOMB)==KEY_FREE){ani;    PlaySE("\koukaonn\sword2.wav"); sai;}

}
}           
}

else{ 
if(OR==1){
         if(GetKeyState(VK_SHOT)==KEY_HOLD){cha=cha+1/40;if(cha==2){cha=2;}}  
  if(GetKeyState(VK_SHOT)==KEY_PULL){  
 task bas1{loop(1){objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-50);
		Obj_SetSpeed(objShot, 19);
		ObjShot_SetGraphic(objShot, 5);
		ObjShot_SetDamage(objShot, 100);
		ObjShot_SetPenetration(objShot, 1);
                Obj_SetAngle(objShot, 270);PlaySE("\koukaonn\se04.wav");loop(20){yield;}}}
task bas2{loop(2){objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-50);
		Obj_SetSpeed(objShot, 19);
		ObjShot_SetGraphic(objShot, 5);
		ObjShot_SetDamage(objShot, 125);
		ObjShot_SetPenetration(objShot, 1);
                Obj_SetAngle(objShot, 270);PlaySE("\koukaonn\se04.wav");loop(15){yield;}}

   }if(cha>1){if(cha>=2){ani2;  bas2;}else{ani2;bas1;}cha=0;}
}}
else{
   if(GetKeyState(VK_SHOT)==KEY_HOLD) {if(GetCommonDataEx("gokusi",AM)>0){cha2=cha2+1/150;}}
if(GetKeyState(VK_SHOT)==KEY_PULL) { if(cha2>=2){ani;PlaySE("\koukaonn\sword2.wav");UseSpellCard("ZAN", true);zan=0;}cha2=0;}
}

                 if(GetKeyState(VK_SHOT)==KEY_PUSH )
		  { 
  
      if(OR==0){               
task sai{
                  angle=340;
             lee=225;
             L=-10;
             A=14;
    if(GetKeyState(VK_LEFT)==KEY_HOLD ){angle=225; L=+10; A=18;}
    if(GetKeyState(VK_RIGHT)==KEY_HOLD ){angle=295; L=-10; A=18;} 
                     
       bki=1;

                objlase = Obj_Create(OBJ_LASER); 
	        Obj_SetX(objlase, GetPlayerX);
		Obj_SetY(objlase, GetPlayerY-10); 
                Obj_SetAngle(objlase,angle);
	        Obj_SetSpeed(objlase, 20);
                ObjShot_SetGraphic(objlase, 4);
                ObjLaser_SetWidth(objlase,30);
                ObjShot_SetDamage(objlase,40);
                ObjLaser_SetSource(objlase,false);     

             loop(A){ 
                  if(GetCommonDataEx("gokusi",BM)>0){CreatePlayerShot01(GetPlayerX(), GetPlayerY(), 20, angle, 5, 1, 1);} 
                  ObjLaser_SetLength(objlase,lee);            
                  Obj_SetAngle(objlase,angle);
                  angle=angle+L;  
	        Obj_SetX(objlase, GetPlayerX);
		Obj_SetY(objlase, GetPlayerY-10);                                    
               yield;     
               } 
  Obj_Delete(objlase);  

bki=0;
                 
                  }

   if(bki==0&&GetKeyState(VK_BOMB)==KEY_FREE){ani;    PlaySE("\koukaonn\sword2.wav"); sai;}
           
}
else{
			       ani2; PlaySE("\koukaonn\tama1.wav");

CreatePlayerShot01(GetPlayerX, GetPlayerY-50, 15, 270, 20, 1, 2); 


cha=0;}
         if(GetKeyState(VK_SHOT)==KEY_HOLD){cha=cha+1/40;if(cha==2){cha=2;}}  
  if(GetKeyState(VK_SHOT)==KEY_PULL){  
 task bas1{loop(1){objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-50);
		Obj_SetSpeed(objShot, 19);
		ObjShot_SetGraphic(objShot, 5);
		ObjShot_SetDamage(objShot, 100);
		ObjShot_SetPenetration(objShot, 1);
                Obj_SetAngle(objShot, 270);PlaySE("\koukaonn\se04.wav");loop(20){yield;}}}
task bas2{loop(2){objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-50);
		Obj_SetSpeed(objShot, 19);
		ObjShot_SetGraphic(objShot, 5);
		ObjShot_SetDamage(objShot, 125);
		ObjShot_SetPenetration(objShot, 1);
                Obj_SetAngle(objShot, 270);PlaySE("\koukaonn\se04.wav");loop(15){yield;}}

   }if(cha>1){if(cha>=2){ani2;  bas2;}else{ani2;bas1;}cha=0;}

   
	
}
}



          
            
   

		

	
		}


		if(shotCount >= 0)
		{
			shotCount++;
		}
		if(shotCount == 30)
		{
			shotCount=-1;
		}
		
		SetIntersectionCircle(GetPlayerX, GetPlayerY, 1);
                if(cha>=2){ObjShot_SetGraphic(objShot2,10 );}
		yield;
		}
		@Missed
		{


 loop{ObjLaser_SetLength(objlase,lee);            
                  Obj_SetAngle(objlase,angle);
                  angle=angle+L;  
	        Obj_SetX(objlase, GetPlayerX);
		Obj_SetY(objlase, GetPlayerY-10);                                    
             yield;
break;} 
 Obj_Delete(objlase);
       B=GetPlayerBomb;
                   
                 SetInitialBombCount(B);   
           if(RC==0){   AddBomb(10);}
RC=1; 
			//自機撃墜時に"@MainLoop"の代わりに呼ばれます
			//MainLoopと同じでよければ
			//@Missed{MainLoop}
			//とかけば、@MainLoopと同じになります。
			//ただし、撃墜時に動けたり弾が撃てると変なので
			//OnMissed関数で撃墜中かを判断してください
		}
		@SpellCard
		{	if(OnEvent()==true){break;};   

	if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{

			if(GetKeyState(VK_BOMB)==KEY_PUSH){

if(GetKeyState(VK_UP)==KEY_HOLD){   angle=270;
if(GetKeyState(VK_RIGHT)==KEY_HOLD&&GetKeyState(VK_UP)==KEY_HOLD){angle=295;}
if(GetKeyState(VK_LEFT)==KEY_HOLD&&GetKeyState(VK_UP)==KEY_HOLD){angle=245;}if(GetCommonDataEx("gokusi",CM)>0){lee=50;L=20;A=30; TOTU;}}
if(GetKeyState(VK_RIGHT)==KEY_HOLD){if(GetCommonDataEx("gokusi",FA)>0){L2=20;A=-13;KOU;}}
if(GetKeyState(VK_LEFT)==KEY_HOLD){if(GetCommonDataEx("gokusi",FA)>0){L2=160;A=13;KOU;}}
if(GetKeyState(VK_DOWN)==KEY_HOLD&&GetKeyState(VK_LEFT)==KEY_FREE&&GetKeyState(VK_RIGHT)==KEY_FREE){if(GetCommonDataEx("gokusi",ST)>0){angle=0;lee=200;L=-18;A=30;  FU;}}
AddBomb(1);
}     	

		}
		else
		{	
		if(GetKeyState(VK_BOMB)==KEY_PUSH){
if(GetKeyState(VK_LEFT)==KEY_HOLD){if(GetCommonDataEx("gokusi",EL)>0){ZETU;}}
if(GetKeyState(VK_RIGHT)==KEY_HOLD){if(GetCommonDataEx("gokusi",EL)>0){ZETU;}}

if(GetKeyState(VK_UP)==KEY_HOLD){if(GetCommonDataEx("gokusi",IC)>0){HIYO;}}


AddBomb(1);}

    

		}


		
	

		}
		
		@DrawLoop
		{bom;
		SetColor(255, 255, 255);
		SetRenderState(ALPHA);
		SetTexture(imgZERO);
               SetAlpha(255);
              dot2=dot-1;
		if(GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD){

			SetGraphicRect(128, 86*dot2, 196, 86*dot);	
   if(GetKeyState(VK_SLOWMOVE)==KEY_FREE&&ha==0){
	SetGraphicRect(440, 0, 568, 86);
}
		}
		
		else if(GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD)
		{
			SetGraphicRect(64, 86*dot2, 128, 86*dot);
	   if(GetKeyState(VK_SLOWMOVE)==KEY_FREE&&ha==0){
			SetGraphicRect(312, 86*dot2, 440, 86*dot);
	}
		}
		else 
		{
			SetGraphicRect(1, 86*dot2, 64, 86*dot);
          if(GetKeyState(VK_UP)==KEY_HOLD||GetKeyState(VK_DOWN)==KEY_HOLD){ SetGraphicRect(256, 86*dot2, 312, 86*dot);}
		}
		DrawGraphic(GetPlayerX(), GetPlayerY());	
		}
		
		@Finalize
		{
		DeleteGraphic(imgZERO);
		}
	}
	


 }
#include_function{.\風陣剣.txt .\延刃突.txt .\光絶閃.txt .\飛月.txt .\紅炎撃.txt}



script_spell hikari
	{
   	let current = GetCurrentScriptDirectory();
let me=0;
let mea=30;
let px=GetPlayerX;

        let angle = 270;
task run{PlaySE("\koukaonn\warp2.wav");
           metu2;   loop(6){  metu; PlaySE("\koukaonn\SE02.wav");loop(5){yield;}me=me+mea;mea=mea+7;}

  loop(180){yield;}
		End();
}

		@Initialize
		{
		SetPlayerInvincibility(60);
               run();
		
		}
		@MainLoop
		{   	      	
  
                   yield;

		}
		@Finalize
		{

		} 
task metu{
	let objme = NULL;
	let objme2 = NULL;
	let s = 0;
               loop(10){objme = Obj_Create(OBJ_SHOT);
		Obj_SetX(objme, px+me);
		Obj_SetY(objme, GetClipMaxY);
		Obj_SetSpeed(objme, 20);
ObjShot_SetPenetration(objme,999);
		ObjShot_SetGraphic(objme, 5);
		ObjShot_SetDamage(objme, 2);
	        Obj_SetAngle(objme,270);

                objme2 = Obj_Create(OBJ_SHOT);
		Obj_SetX(objme2, px-me);
		Obj_SetY(objme2, GetClipMaxY);
		Obj_SetSpeed(objme2, 20);
ObjShot_SetPenetration(objme2,999);
		ObjShot_SetGraphic(objme2, 5);
		ObjShot_SetDamage(objme2, 2);
	        Obj_SetAngle(objme2,270);


yield; 
  }

               

}task metu2{
	let objme = NULL;
	let objme2 = NULL;
	let s = 0;
               loop(10){objme = Obj_Create(OBJ_SHOT);
		Obj_SetX(objme, px+me);
		Obj_SetY(objme, GetClipMaxY);
		Obj_SetSpeed(objme, 20);
ObjShot_SetPenetration(objme,999);
		ObjShot_SetGraphic(objme, 5);
		ObjShot_SetDamage(objme, 6);
	        Obj_SetAngle(objme,270);


yield; 
  }}  }
script_spell ZAN
	{
   	let current = GetCurrentScriptDirectory();
          let   angle=180;
           let  lee=225;
            let L=10;
            let A=16;

        task run()	{
                sai;
                loop(A+60){yield;}
		End();
	}

		@Initialize
		{
                run();


		
		}
		@MainLoop
		{  if(GetKeyState(VK_BOMB)==KEY_PUSH){} 	      	

                   yield;

		}
		@Finalize
		{

		} 
             let objlase = NULL;       
             angle=0;
             lee=225;
             L=-10;
             A=18;
    if(GetKeyState(VK_LEFT)==KEY_HOLD ){angle=225; L=+10; A=18;}
    if(GetKeyState(VK_RIGHT)==KEY_HOLD ){angle=295; L=-10; A=18;}                      
task sai{
                 
               if(!Obj_BeDeleted(objlase)){return;}
                objlase = Obj_Create(OBJ_LASER); 
	        Obj_SetX(objlase, GetPlayerX);
		Obj_SetY(objlase, GetPlayerY-10); 
                Obj_SetAngle(objlase,angle);
	        Obj_SetSpeed(objlase, 20);
                ObjShot_SetGraphic(objlase, 6);
                ObjLaser_SetWidth(objlase,30);
                ObjShot_SetDamage(objlase,80);
                ObjLaser_SetSource(objlase,false);      
             loop(A){   ObjLaser_SetLength(objlase,lee);            
                  Obj_SetAngle(objlase,angle);
                  angle=angle+L;  
	        Obj_SetX(objlase, GetPlayerX);
		Obj_SetY(objlase, GetPlayerY-10);                                    
                 yield;     
               } 

  Obj_Delete(objlase);                       
                  }      

}  }
