Advertisement
Guest User

Untitled

a guest
May 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  function collisionDetection() {
  2.         for (c = 0; c < brickColumnCount; c++) {
  3.             for (r = 0; r < brickRowCount; r++) {
  4.                 //
  5.                 var b = bricks[c][r];
  6.                 if (b.status == 1) {
  7.                     if (x+10 > b.x && x+10 < b.x + brickWidth && y+12 > b.y && y-12 < b.y + brickHeight) {
  8.                         dy = -dy;
  9.                         b.status = 0;
  10.                         // Faire disparaitre la brick //
  11.                         score++;
  12.                         // Augmenter le score de 1 //
  13.                         if (score == brickRowCount * brickColumnCount) {
  14.                             document.getElementById("section5").style.display = "none";
  15.                             document.getElementById("section92").style.display = "block";
  16.                             lives = 9999;
  17.                             // Vérifie le nombre de brique, si nombre = 0, passer au message de victoire //
  18.                             /*alert("Victoire, que la force soit avec toi!");
  19.                             // Message de victoire //
  20.                             document.location.reload();
  21.                             // Reload la fenêtre de jeu après la victoire //*/
  22.                         }
  23.                     }
  24.                 }
  25.             }
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement