This commit is contained in:
Baptiste 2023-12-27 19:08:32 +01:00
parent 4230231962
commit 3c47694f3d

View file

@ -173,21 +173,17 @@ function updateBullets(dt)
let lastbulletdonjon=[0] let lastbulletdonjon=[0]
function Donjon() { function Donjon() {
if(player.z==10) { if(player.z==10) {
if(lastbulletdonjon[0]==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
for(let i=0;i<5;i++){
bullets.push(new Bullet(235,65,10,0,2,-2)); bullets.push(new Bullet(235,65,10,0,2,-2));
bullets.push(new Bullet(235,491,10,0,-2,-2)); bullets.push(new Bullet(235,491,10,0,-2,-2));
bullets.push(new Bullet(395,65,10,0,2,-2)); bullets.push(new Bullet(395,65,10,0,2,-2));
bullets.push(new Bullet(395,491,10,0,-2,-2)); bullets.push(new Bullet(395,491,10,0,-2,-2));
bullets.push(new Bullet(104,209,10,2,0,-2));
bullets.push(new Bullet(107,356,10,2,0,-2));
bullets.push(new Bullet(235,65,10,0,2,-2));
bullets.push(new Bullet(235,491,10,0,-2,-2));
bullets.push(new Bullet(395,65,10,0,2,-2));
bullets.push(new Bullet(395,491,10,0,-2,-2));
bullets.push(new Bullet(104,209,10,2,0,-2));
bullets.push(new Bullet(107,356,10,2,0,-2));
} }
} }
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));
}
} }