Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function collisionDetection() {
- for (c = 0; c < brickColumnCount; c++) {
- for (r = 0; r < brickRowCount; r++) {
- //
- var b = bricks[c][r];
- if (b.status == 1) {
- if (x+10 > b.x && x+10 < b.x + brickWidth && y+12 > b.y && y-12 < b.y + brickHeight) {
- dy = -dy;
- b.status = 0;
- // Faire disparaitre la brick //
- score++;
- // Augmenter le score de 1 //
- if (score == brickRowCount * brickColumnCount) {
- document.getElementById("section5").style.display = "none";
- document.getElementById("section92").style.display = "block";
- lives = 9999;
- // Vérifie le nombre de brique, si nombre = 0, passer au message de victoire //
- /*alert("Victoire, que la force soit avec toi!");
- // Message de victoire //
- document.location.reload();
- // Reload la fenêtre de jeu après la victoire //*/
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement