Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. var estouradas = 0;
  2.  
  3. <span id="pontuacao">0</span>
  4.  
  5. var temporizador; // para o setInterval
  6. var timer = 1000; // tempo inicial do setInterval, que será alterado dinamicamente
  7.  
  8. if(estouradas%5 == 0){
  9. clearInterval(temporizador); // cancela o setInterval
  10. timer -= 100; // decrementa o tempo
  11. iniciar(timer); // inicia novamente com um novo tempo
  12. }
  13.  
  14. function iniciar(t){
  15. temporizador = setInterval(addBola, t);
  16. }
  17.  
  18. <body onload="iniciar(1000)">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement