n is the same every loop, even though i set it differently every iteration of setInterval. Anyone know a fix or another way I can randomise n every time?
var n = random(1000, 5000);
let toptimer = setInterval(()=>{
n = random(1000, 5000);
obs.push(new obstacle(800, 200, 255));
},n);
Aucun commentaire:
Enregistrer un commentaire