From e70e9a09afa7a82e3a9c42f8808639f15f2f13b8 Mon Sep 17 00:00:00 2001 From: Baptiste Date: Thu, 28 Dec 2023 13:53:34 +0100 Subject: [PATCH] feat:diminution du nombre de balles dans le donjon --- public_html/js/global.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public_html/js/global.js b/public_html/js/global.js index bb455be..0e48ea1 100644 --- a/public_html/js/global.js +++ b/public_html/js/global.js @@ -177,6 +177,13 @@ function updateBullets(dt) let lastbulletdonjon=[0,0] function Donjon() { 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(Math.floor(Date.now()/1000)%60 > lastbulletdonjon[0]) { lastbulletdonjon[0]=Math.floor(Date.now()/1000)%60 @@ -189,12 +196,5 @@ function Donjon() { 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]++ - } } } \ No newline at end of file