feat:diminution du nombre de balles dans le donjon
This commit is contained in:
		
							parent
							
								
									9c7b9649c5
								
							
						
					
					
						commit
						e70e9a09af
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		|  | @ -177,6 +177,13 @@ function updateBullets(dt) | ||||||
| let lastbulletdonjon=[0,0] | let lastbulletdonjon=[0,0] | ||||||
| function Donjon() { | function Donjon() { | ||||||
|     if(player.z==10) { |     if(player.z==10) { | ||||||
|  |         if(lastbulletdonjon[1]>=7) { | ||||||
|  |             lastbulletdonjon[1]=0 | ||||||
|  |             bullets.push(new Bullet(107,95+(Date.now()*0.1)%365,10,1,0,-2)); | ||||||
|  |             bullets.push(new Bullet(107,460-(Date.now()*0.1)%365,10,1,0,-2)); | ||||||
|  |         } else { | ||||||
|  |             lastbulletdonjon[1]++ | ||||||
|  |         } | ||||||
|         if(lastbulletdonjon[0]==59 && Math.floor(Date.now()/1000)%60 !=59) { lastbulletdonjon[0]=0 } |         if(lastbulletdonjon[0]==59 && Math.floor(Date.now()/1000)%60 !=59) { lastbulletdonjon[0]=0 } | ||||||
|         if(Math.floor(Date.now()/1000)%60 > lastbulletdonjon[0]) {     |         if(Math.floor(Date.now()/1000)%60 > lastbulletdonjon[0]) {     | ||||||
|             lastbulletdonjon[0]=Math.floor(Date.now()/1000)%60 |             lastbulletdonjon[0]=Math.floor(Date.now()/1000)%60 | ||||||
|  | @ -189,12 +196,5 @@ function Donjon() { | ||||||
|                 bullets.push(new Bullet(615,385,10,0,-2,-2)); |                 bullets.push(new Bullet(615,385,10,0,-2,-2)); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         if(lastbulletdonjon[1]==5) { |  | ||||||
|             lastbulletdonjon[1]=0 |  | ||||||
|             bullets.push(new Bullet(107,95+(Date.now()*0.1)%365,10,1,0,-2)); |  | ||||||
|             bullets.push(new Bullet(107,460-(Date.now()*0.1)%365,10,1,0,-2)); |  | ||||||
|         } else { |  | ||||||
|             lastbulletdonjon[1]++ |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Loading…
	
		Reference in a new issue