Code actuel (09/05/2015)

Le programme en .pde, .exe pour Windows 32 et 64 bits est disponible en suivant ce lien : drive.google.com/folderview?id=0B2MwLLRZeCZrb0U1d25HaXNfY3c&usp=sharing

 

 

                                                        //ONGLET GENERAL//


int crect = 30;
int map[][] = new int[870][570];
int g, h;
int g1, h1;
int b = 0, b1 = 0;
//MENU
boolean menu = true;
PFont texteMenu;
PImage logo;
//OBJET BOMBE PERSO                      
Bombe Bombe1;
//OBJET BOMBE PERSO1
Bombe_1 Bombe1_1;
//IMAGES BLOCS
PImage blocdur;
PImage blocmou;
//IMAGES BOMBES
PImage bombe;
PImage bombe1;
PImage warning;
PImage Burnl;
PImage Burnu;
PImage Burnm;
PImage Burnb;
PImage Burnh;
PImage Burng;
PImage Burnd;
//IMAGES BONUS
PImage BombUp;
PImage FlameUp;
PImage OverWalls;
PImage FootBomb;
PImage Invincibility;
PImage PowerFull;




void setup() {
  //IMAGES MENU  
  logo = loadImage("logo.jpg");
  texteMenu = createFont("Arial", 35, true);
  //IMAGES BLOC
  blocdur = loadImage("blocdur.jpg");
  blocmou = loadImage("blocmou.jpg");
  //IMAGES BOMBES
  bombe = loadImage("Bomb.jpg");
  bombe1 = loadImage("Bomb1.jpg");
  warning = loadImage("Bomb2.jpg");
  Burnl = loadImage("Burnl.jpg");
  Burnu = loadImage("Burnu.jpg");
  Burnm = loadImage("Burnm.jpg");
  Burnb = loadImage("Burnb.jpg");
  Burnh = loadImage("Burnh.jpg");
  Burng = loadImage("Burng.jpg");
  Burnd = loadImage("Burnd.jpg");
  //IMAGES BONUS
  BombUp = loadImage("BombUp.jpg");
  FlameUp = loadImage("FlameUp.jpg");
  OverWalls = loadImage("OverWalls.jpg");
  FootBomb = loadImage("FootBomb.jpg");
  Invincibility = loadImage("Invincibility.jpg");
  PowerFull = loadImage("PowerFULL.jpg");


  //PARAMETRES DE BASE + OBJETS
  size(870, 570);
  frameRate(50);
  carte();
  Bombe1 = new Bombe( g, h, b, def, OW) ;
  Bombe1_1 = new Bombe_1( g1, h1, b1, def1, OW1) ;
}





void draw() {

  if (menu == true) {
    afficherMenu();
    carte();
  }

  if (menu == false) {
    afficherc();
    noStroke();
  }


  println(map[mouseX/crect][mouseY/crect]);
  println(b);
  println(b1);
}



void respawn() {                                     
  boom = true;
  boom1 = true;
  menu = true;
  x = 1;
  y = 1;
  x1 = 27;
  y1 = 17;
  def = 2;
  def1 = 2;
  OW = false;
  OW1 = false;
  PowerFULL = false;
  PowerFULL1 = false;
}

 

                                            //ONGLET BOMBE//

 

class Bombe {

  Bombe(int xBomb, int yBomb, int compteur, int deflagration, boolean OverWalls) {        //constructeur
    g = xBomb;
    h = yBomb;
    b = compteur;
    def = deflagration;
    OW = OverWalls;
  }


  void display() {        //affichage
    boolean blocg = true;
    boolean blocb = true;
    boolean blocd = true;
    boolean bloch = true;
    boolean boom = true;



    if (key == 'b' || key == 'B') {       //poser la bombe

      bomb = true;
    }

    if (bomb == true) {
      b++;                              //incrément pour le compteur
    }



    if (b == 70)                         //changement des images suivant le compteur
      map[g][h] = 11;

    if (b == 80)
      map[g][h] = 12;

    if (b == 85)
      map[g][h] = 13;

    if (b >= 90) {

      boom = true;





      for (int l = g; l < g+def; l++) {                 //collisions de la bombe à droite

        map[x][y] = 30;
        map[x1][y1] = 31;

        if (boom == true && blocg == true) {            //bloc dur
          if (map[l][h] == 2) {
            boom = false;
          }
          if (map[l][h] == 0) {                       //case vide
            bomb = false;
            blocd = true;
            image(Burnl, l*crect, h*crect);           //image pour les flammes
            if ( l == g+def-1) {
              image(Burnd, l*crect, h*crect);
            }
          }
          if (map[l][h] == 4) {                          //bonus FlameUp
            map[l][h] = 20;
          }
          if (map[l][h] == 6) {                        //bonus OverWalls
            map[l][h] = 22;
          }
          if (map[l][h] == 1 || map[l][h] == 3 || map[l][h] == 5 || map[l][h] == 7) {          //blocs cassables
            map[l][h] = 0;
            bomb = false;
            blocd = false;
          }
          if (OW == true) {                  //activation de OverWalls
            blocd = true;
          }
          if (map[l][h] == 8) {              //bonus PowerFULL
            map[l][h] = 28;
          }
          if (map[l][h] == 30 || map[l][h] == 31) {      //Mort d'un des joueurs
            respawn();
          }
        }
        map[x][y] = 0;
        map[x1][y1] = 0;
      }
      boom = true;


      for (int l = h; l < h+def; l++) {                 //collision de la bombe en bas

        map[x][y] = 30;
        map[x1][y1] = 31;

        if (boom == true && blocb == true) {
          if (map[g][l] == 2) {
            boom = false;
          }
          if (map[g][l] == 0) {
            bomb = false;
            blocb = true;
            image(Burnu, g*crect, l*crect);           
            if ( l == h+def+1) {
              image(Burnb, g*crect, l*crect);
            }
          }

          if (map[g][l] == 4) {
            map[g][l] = 20;
          }
          if (map[g][l] == 6) {
            map[g][l] = 22;
          }
          if (map[g][l] == 1 || map[g][l] == 3 || map[g][l] == 5 || map[g][l] == 7) {
            map[g][l] = 0;
            bomb = false;
            blocb = false;
          }
          if (OW == true) {
            blocb = true;
          }
          if (map[g][l] == 8) {
            map[g][l] = 28;
          }
          if (map[g][l] == 30 || map[g][l] == 31) {
            respawn();
          }
        }
        map[x][y] = 0;
        map[x1][y1] = 0;
      }
      boom = true;


      for (int l = g; l > g-def; l--) {                     //collision de la bombe à gauche

        map[x][y] = 30;
        map[x1][y1] = 31;

        if (boom == true && blocd == true) {
          if (map[l][h] == 2) {
            boom = false;
          }
          if (map[l][h] == 0) {
            bomb = false;
            blocg = true;
            image(Burnl, l*crect, h*crect);           
            if ( l == g+def+1) {
              image(Burng, l*crect, h*crect);
            }
          }

          if (map[l][h] == 4) {
            map[l][h] = 20;
          }
          if (map[l][h] == 6) {
            map[l][h] = 22;
          }
          if (map[l][h] == 1 || map[l][h] == 3 || map[l][h] == 5 || map[l][h] == 7) {
            map[l][h] = 0;
            bomb = false;
            blocg = false;
          }
          if (map[l][h] == 8) {
            map[l][h] = 28;
          }
          if (OW == true) {
            blocg = true;
          }
          if (map[l][h] == 30 || map[g][l] == 31) {
            respawn();
          }
        }
        map[x][y] = 0;
        map[x1][y1] = 0;
      }
      boom = true;



      for (int l = h; l > h-def; l--) {                  //collision de la bombe en haut

        map[x][y] = 30;
        map[x1][y1] = 31;

        if (boom == true && bloch == true) {
          if (map[g][l] == 2) {
            boom = false;
          }
          if (map[g][l] == 0) {
            bomb = false;
            bloch = true;
            image(Burnu, g*crect, l*crect);           
            if ( l == h+def-1) {
              image(Burnh, g*crect, l*crect);
            }
          }

          if (map[g][l]==4) {
            map[g][l] = 20;
          }
          if (map[g][l] == 6) {
            map[g][l] = 22;
          }
          if (map[g][l] == 1 || map[g][l] == 3 || map[g][l] == 5 || map[g][l] == 7) {
            map[g][l] = 0;
            bomb = false;
            bloch = false;
          }
          if (OW == true) {
            bloch = true;
          }
          if (map[g][l] == 8) {
            map[g][l] = 28;
          }
          if (map[g][l] == 30 || map[g][l] == 31) {
            respawn();
          }
        }
        map[x][y] = 0;
        map[x1][y1] = 0;
      }
      boom = true;



      if (bomb == false) {              //réinitialisation des cases touchées
        b = 0;
        map[g][h] = 0;
        limiteur --;
      }
    }
  }
}
 

 

                                                    //ONGLET BOMBE_1//

class Bombe_1 {

  Bombe_1(int xBomb1, int yBomb1, int compteur1, int deflagration1, boolean OverWalls1) {
    g1 = xBomb1;
    h1 = yBomb1;
    b1 = compteur1;
    def1 = deflagration1;
    OW1 = OverWalls1;
  }


  void display() {
    boolean blocg = true;
    boolean blocb = true;
    boolean blocd = true;
    boolean bloch = true;
    boolean boom1 = true;



    if (key == '0') {

      bomb1 = true;
    }

    if (bomb1 == true) {
      b1++;
    }



    if (b1 == 70)
      map[g1][h1] = 11;

    if (b1 == 80)
      map[g1][h1] = 12;

    if (b1 == 85)
      map[g1][h1] = 13;


    if (b1 >= 90) {
      boom1 = true;


      for (int l1 = g1; l1 < g1+def1; l1++) {

        map[x][y] = 15;
        map[x1][y1] = 16;

        if (boom1 == true && blocg == true) {
          if (map[l1][h1] == 2) {
            boom1 = false;
          }
          if (map[l1][h1] == 0) {
            bomb1 = false;
            blocd = true;
            image(Burnl, l1*crect, h1*crect);         
            if ( l1 == g1+def1-1) {
              image(Burnd, l1*crect, h1*crect);
            }
          }
          if (map[l1][h1] == 4) {
            map[l1][h1] = 20;
          }
          if (map[l1][h1] == 6) {
            map[l1][h1] = 22;
          }
          if (map[l1][h1] == 1 || map[l1][h1] == 3 || map[l1][h1] == 5 || map[l1][h1] == 7) {
            map[l1][h1] = 0;
            bomb1 = false;
            blocd = false;
          }
          if (OW1 == true) {
            blocd = true;
          }
          if (map[l1][h1] == 15 || map[l1][h1] == 16) {
            respawn();
          }
        }
        map[x][y] = 0;
        map[x1][y1] = 0;
      }  
      boom1 = true;


      for (int l1 = h1; l1 < h1+def1; l1++) {
        map[x][y] = 15;
        map[x1][y1] = 16;
        if (boom1 == true && blocb == true) {
          if (map[g1][l1] == 2) {
            boom1 = false;
          }
          if (map[g1][l1] == 0) {
            bomb1 = false;
            blocb = true;
            image(Burnu, g1*crect, l1*crect);           
            if ( l1 == h1+def1+1) {
              image(Burnb, g1*crect, l1*crect);
            }
          }
          if (map[g1][l1] == 4) {
            map[g1][l1] = 20;
          }
          if (map[g1][l1] == 6) {
            map[g1][l1] = 22;
          }
          if (map[g1][l1] == 1 || map[g1][l1] == 3 || map[g1][l1] == 5 || map[g1][l1] == 7) {
            map[g1][l1] = 0;
            bomb1 = false;
            blocb = false;
          }
          if (OW1 == true) {
            blocb = true;
          }

          if (map[g1][l1] == 15 || map[g1][l1] == 16) {
            respawn();
          }
        }
        map[x][y] = 0;
        map[x1][y1] = 0;
      }
      boom1 = true;


      for (int l1 = g1; l1 > g1-def1; l1--) {
        map[x][y] = 15;
        map[x1][y1] = 16;
        if (boom1 == true && blocd == true) {
          if (map[l1][h1] == 2) {
            boom1 = false;
          }
          if (map[l1][h1] == 0) {
            bomb1 = false;
            blocg = true;
            image(Burnl, l1*crect, h1*crect);           
            if ( l1 == g1+def1+1) {
              image(Burng, l1*crect, h1*crect);
            }
          }
          if (map[l1][h1] == 4) {
            map[l1][h1] = 20;
          }
          if (map[l1][h1] == 6) {
            map[l1][h1] = 22;
          }
          if (map[l1][h1] == 1 || map[l1][h1] == 3 || map[l1][h1] == 5 || map[l1][h1] == 7) {
            map[l1][h1] = 0;
            bomb1 = false;
            blocg = false;
          }

          if (OW1 == true) {
            blocg = true;
          }
          if (map[l1][h1] == 15 || map[l1][h1] == 16) {
            respawn();
          }
        }
        map[x][y] = 0;
        map[x1][y1] = 0;
      }
      boom1 = true;

      for (int l1 = h1; l1 > h1-def1; l1--) {
        map[x][y] = 15;
        map[x1][y1] = 16;
        if (boom1 == true && bloch == true) {
          if (map[g1][l1] == 2) {
            boom1 = false;
          }
          if (map[g1][l1] == 0) {
            bomb1 = false;
            bloch = true;
            image(Burnu, g1*crect, l1*crect);           
            if ( l1 == h1+def1-1) {
              image(Burnh, g1*crect, l1*crect);
            }
          }
          if (map[g1][l1] == 4) {
            map[g1][l1] = 20;
          }
          if (map[g1][l1] == 6) {
            map[g1][l1] = 22;
          }
          if (map[g1][l1] == 1 || map[g1][l1] == 3 || map[g1][l1] == 5 || map[g1][l1] == 7) {
            map[g1][l1] = 0;
            bomb1 = false;
            bloch = false;
          }
          if (OW1 == true) {
            bloch = true;
          }
          if (map[g1][l1] == 15 || map[g1][l1] == 16) {
            respawn();
          }
        }
        map[x][y] = 0;
        map[x1][y1] = 0;
      }
      boom1 = true;


      if (bomb1 == false) {
        b1 = 0;
        map[g1][h1] = 0;
        limiteur1 --;
      }
    }
  }
}
 

 

                                                //ONGLET BONUS//

 

int def = 2, def1 = 2;
boolean OW = false, OW1 = false;
int nombreBombe = 1, nombreBombe1 = 1;
int limiteur = 0, limiteur1 = 0;
boolean PowerFULL = false, PowerFULL1 = false;
 

 

                                                     //ONGLET MAP//

 

void carte() {   
  for (int i = 0; i     for (int j = 0; j       int u = i/crect;
      int v = j/crect;
      map[u][v] = 0;
      int pariteLigne;
      int pariteColonne;
      int r;
      int rFlameUp;
      int rFoot;
      int rInvic;
      int rOverWalls;
      int rPower;
      int rBombUp;
      boolean rItem = true;




      //blocs cassables

      r = int(random(2));
      if (r==1) {
        map[u][v] = 1;
      }


      r = int(random(3));
      if (r==1) {
        map[u][v] = 1;
      }


      //safe zone

      if (u == 1 && v >= 1 && v<=3 || v == 1 && u >= 1 && u<= 3) {
        map[u][v] = 0;
      }
      if (u == 27 && v >= 15 && v<=18 || v == 17 && u >= 25 && u<= 28) {
        map[u][v] = 0;
      }

      //blocs durs

      if (u == 0 || v == 0 || u == 28 || v == 18) {
        map[u][v] = 2;
      }

      pariteLigne = u % 2;
      pariteColonne = v % 2;

      if (pariteLigne == 0 && pariteColonne == 0) {
        map[u][v] = 2;
      }  

      if (map[u][v]==1) {
        r =int(random(2));
        if (r==1) {                        //répartition des items avec random()

          if (rItem = true) {
            rBombUp = int(random(4));
            if (rBombUp == 1) {
              map[u][v] = 3;           //blocmou + BombUp = 3
            }
          }          

          if (rItem = true) {
            rBombUp = int(random(3));
            if (rBombUp == 1) {
              map[u][v] = 3;           //blocmou + BombUp = 3
              rItem = false;
            }
          }   

          if (rItem = true) {
            rFlameUp = int(random(4));
            if (rFlameUp == 1) {
              map[u][v] = 4;        //blocmou + FlameUp = 4
            }
          }

          if (rItem = true) {
            rFlameUp = int(random(3));
            if (rFlameUp == 1) {
              map[u][v] = 4;        //blocmou + FlameUp = 4
              rItem = false;
            }
          }


          if (rItem = true) {    
            rOverWalls = int(random(50)); //blocmou + OverWalls = 6
            if (rOverWalls == 1) {
              map[u][v] = 6;
              rItem = false;
            }
          }

          map[14][9] = 8;              //blocmou + PowerFULL = 8
        }
      }
    }
  }
}




void afficherc() {



  for (int i = 0; i     for (int j = 0; j       int u = i/crect;
      int v = j/crect;


      //affichage



      if (map[u][v] == 0 ) {            //case vide
        fill(#167C0E);
        rect(i, j, crect, crect);
      }
      if (map[u][v]==1) {              //bloc mou sans bonus
        image(blocmou, i, j);
      }
      if (map[u][v] == 2) {            //bloc dur
        image(blocdur, i, j);
      }
      if (map[u][v] == 4) {            //bloc mou avec FlameUp
        image(blocmou, i, j);
      }
      if (map[u][v] == 6) {            //bloc mou avec OverWalls
        image(blocmou, i, j);
      }
      if (map[u][v] == 8) {            //bloc mou avec PowerFULL
        image(blocmou, i, j);
      }
      if (map[u][v] == 10) {           //image de la bombe
        image(bombe, i, j);
      }
      if (map[u][v] == 11) {           //image de la bombe1
        image(bombe1, i, j);
      }
      if (map[u][v] == 12) {           //image de la bombe2
        image(warning, i, j);
      }
      if (map[u][v] == 13) {           //image de la déflagration au milieu
        image(Burnm, i, j);
      }
      if (map[u][v] == 14) {           //image de la déflagration à droite
        image(Burnd, i, j);
      }
      if (map[u][v] == 15) {           //image de la déflagration en bas
        image(Burnb, i, j);
      }
      if (map[u][v] == 16) {           //image de la déflagration en haut
        image(Burnh, i, j);
      }
      if (map[u][v] == 17) {           //image de la déflagration à gauche
        image(Burng, i, j);
      }
      if (map[u][v] == 20) {           //image du bonus FlameUp fonctionnel
        image(FlameUp, i, j);
      }
      if (map[u][v] == 22) {           //image du bonus OverWalls fonctionnel
        image(OverWalls, i, j);
      }
      if (map[u][v] == 28) {           //image du bonus PowerFULL fonctionnel
        image(PowerFull, i, j);
      }
    }
  }
  perso();
  perso1();

  if (bomb == true) {
    Bombe1.display();
  }
  if (bomb1 == true) {
    Bombe1_1.display();
  }
}
 

 

                                                            //ONGLET MENU//

 

void afficherMenu() {

  image(logo, 0, 0);


  fill(#7994CB);
  noStroke();
  rect(650, 400, 210, 50);
  fill(255);
  textFont(texteMenu);
  text("Commencer", 660, 436);

  fill(#7994CB);
  noStroke();
  rect(650, 460, 210, 50);
  fill(255);
  textFont(texteMenu);
  text("Quitter", 700, 496);

  //CHANGEMENT AU PASSAGE DE LA SOURIS
  if (mouseX >=650 && mouseX<=860 && mouseY >=400 && mouseY <=450) {
    fill(#2E8BC6);
    rect(650, 400, 210, 50);
    stroke(0);
    fill(255);
    textFont(texteMenu);
    text("Commencer", 660, 436);
  }

  if (mouseX >=650 && mouseX<=860 && mouseY >=460 && mouseY <=460+50) {
    fill(#2E8BC6);
    rect(650, 460, 210, 50);
    fill(255);
    textFont(texteMenu);
    text("Quitter", 700, 496);
  }

  //CLIC DES BOUTONS
  if (mousePressed == true) {
    if (mouseX >=650 && mouseX<=860 && mouseY >=400 && mouseY <=450) {
      menu = false;
    }
    if (mouseX >=650 && mouseX<=860 && mouseY >=460 && mouseY <=460+50) {
      exit();
    }
  }
}
 

 

                                                    //ONGLET PERSOS_ET_COLLISIONS//

 

//position initiale perso + direction + bombe
boolean immobile = true;
boolean droite = false;
boolean gauche = false;
boolean haut = false;
boolean bas = false;
int x = 1;
int y = 1;
boolean bomb = false;

//position initiale perso1 + direction1 + bombe1
boolean immobile1 = true;
boolean droite1 = false;
boolean gauche1 = false;
boolean haut1 = false;
boolean bas1 = false;
int x1 = 27;
int y1 = 17;
boolean bomb1 = false;



void perso() {
  PImage persoh = loadImage("Persoh.jpg");
  PImage persob = loadImage("Persob.jpg");
  PImage persog = loadImage("Persog.jpg");
  PImage persod = loadImage("Persod.jpg");


  if (immobile == true) {
    image(persob, x*crect+5, y*crect);
  }
  if (droite == true) {
    image(persod, x*crect+5, y*crect);
  }
  if (gauche == true) {
    image(persog, x*crect+5, y*crect);
  }
  if (bas == true) {
    image(persob, x*crect+5, y*crect);
  }
  if (haut == true) {
    image(persoh, x*crect+5, y*crect);
  }


  if (map[x][y] == 20) {                       //changement de la variable suite à FlameUp
    def ++;
    map[x][y] = 1;
    map[x][y] = 0;
  }

  if (PowerFULL == false) {                    //condition de la portée et des effets de la bombe à cause de PowerFULL
    if (def == 11) {
      def --;
    }
  } else {
    def = 30;
    OW = true;
  }

  if (map[x][y] == 28) {                     //activation de PowerFULL
    PowerFULL = true;
    map[x][y] = 1;
    map[x][y] = 0;
  }

  if (map[x][y] == 22) {                    //activation de OverWalls
    OW = true;
    map[x][y] = 1;
    map[x][y] = 0;
  }
}



void perso1() {

  PImage perso1h = loadImage("Perso1h.jpg");
  PImage perso1b = loadImage("Perso1b.jpg");
  PImage perso1g = loadImage("Perso1g.jpg");
  PImage perso1d = loadImage("Perso1d.jpg");


  if (immobile1 == true) {
    image(perso1b, x1*crect+5, y1*crect);
  }
  if (droite1 == true) {
    image(perso1d, x1*crect+5, y1*crect);
  }
  if (gauche1 == true) {
    image(perso1g, x1*crect+5, y1*crect);
  }
  if (bas1 == true) {
    image(perso1b, x1*crect+5, y1*crect);
  }
  if (haut1 == true) {
    image(perso1h, x1*crect+5, y1*crect);
  }

  if (map[x1][y1] == 20) {
    def1 ++;
    map[x1][y1] = 1;
    map[x1][y1] = 0;
  }

  if (PowerFULL1 == false) {
    if (def1 == 11) {
      def1 --;
    }
  } else {
    def1 = 30;
    OW1 = true;
  }

  if (map[x1][y1] == 28) {
    PowerFULL1 = true;
    map[x1][y1] = 1;
    map[x1][y1] = 0;
  }

  if (map[x1][y1]==22) {
    OW1 = true;
    map[x1][y1] = 1;
    map[x1][y1] = 0;
  }
}




void keyPressed() { //PERSO
  if (key == 'z' || key == 'Z') {
    if (map[x][y-1] == 1 || map[x][y-1] == 2 || map[x][y-1] == 3 || map[x][y-1] == 4 || map[x][y-1] == 5 || map[x][y-1] == 6 || map[x][y-1] == 7 || map[x][y-1] == 8 || map[x][y-1] == 10 || map[x][y-1] == 11 || map[x][y-1] == 12) {
      haut = false;
    } else {
      droite = false;
      gauche = false;
      haut = true;
      bas = false;
      y--;
    }
  }

  if (key == 's' || key == 'S') {
    if (map[x][y+1] == 1 || map[x][y+1] == 2 || map[x][y+1] == 3 || map[x][y+1] == 4 || map[x][y+1] == 5 || map[x][y+1] == 6 || map[x][y+1] == 7 || map[x][y+1] == 8 || map[x][y+1] == 10 || map[x][y+1] == 11 || map[x][y+1] == 12) {
      bas = false;
    } else {
      droite = false;
      gauche = false;
      haut = false;
      bas = true;
      y++;
    }
  }

  if (key == 'd' || key == 'D') {
    if (map[x+1][y] == 1 || map[x+1][y] == 2 || map[x+1][y] == 3 || map[x+1][y] == 4 || map[x+1][y] == 5 || map[x+1][y] == 6 || map[x+1][y] == 7 || map[x+1][y] == 8 || map[x+1][y] == 10 || map[x+1][y] == 11 || map[x+1][y] == 12) {
      droite = false;
    } else {
      droite = true;
      gauche = false;
      haut = false;
      bas = false;
      x++;
    }
  }

  if (key == 'q' || key == 'Q') {
    if (map[x-1][y] == 1 || map[x-1][y] == 2 || map[x-1][y] == 3 || map[x-1][y] == 4 || map[x-1][y] == 5 || map[x-1][y] == 6 || map[x-1][y] == 7 || map[x-1][y] == 8 || map[x-1][y] == 10 || map[x-1][y] == 11 || map[x-1][y] == 12) {
      gauche = false;
    } else {
      droite = false;
      gauche = true;
      haut = false;
      bas = false;
      x--;
    }
  }







  if (key == 'b' || key == 'B') {

    if (nombreBombe == 1) {                  //LIMITEUR
      if (limiteur == 0) {
        g = x;
        h = y;
        map[g][h] = 10;
        bomb = true;
        limiteur = limiteur +1;
      }
    }   


    if (nombreBombe == 2) {
      if (limiteur == 1 || limiteur == 0) {
        g = x;
        h = y;
        map[g][h] = 10;
        bomb = true;
        limiteur = limiteur +1;
      }
    }   


    if (nombreBombe == 3) {
      if (limiteur <= 2) {
        g = x;
        h = y;
        map[g][h] = 10;
        bomb = true;
        limiteur = limiteur +1;
      }
    }   


    if (nombreBombe == 4) {
      if (limiteur <= 3) {
        g = x;
        h = y;
        map[g][h] = 10;
        bomb = true;
        limiteur = limiteur +1;
      }
    }   


    if (nombreBombe == 5) {
      if (limiteur <= 4) {
        g = x;
        h = y;
        map[g][h] = 10;
        bomb = true;
        limiteur = limiteur +1;
      }
    }
  }








  //PERSO1


    if (key == '8') {
    if (map[x1][y1-1] == 1 || map[x1][y1-1] == 2 || map[x1][y1-1] == 3 || map[x1][y1-1] == 4 || map[x1][y1-1] == 5 || map[x1][y1-1] == 6 || map[x1][y1-1] == 7 || map[x1][y1-1] == 8 || map[x1][y1-1] == 10 || map[x1][y1-1] == 11 || map[x1][y1-1] == 12) {
      haut1 = false;
    } else {
      droite1 = false;
      gauche1 = false;
      haut1 = true;
      bas1 = false;
      y1--;
    }
  }

  if (key == '2') {
    if (map[x1][y1+1] == 1 || map[x1][y1+1] == 2 || map[x1][y1+1] == 3 || map[x1][y1+1] == 4 || map[x1][y1+1] == 5 || map[x1][y1+1] == 6 || map[x1][y1+1] == 7 || map[x1][y1+1] == 8 || map[x1][y1+1] == 10 || map[x1][y1+1] == 11 || map[x1][y1+1] == 12) {
      bas1 = false;
    } else {
      droite1 = false;
      gauche1 = false;
      haut1 = false;
      bas1 = true;
      y1++;
    }
  }

  if (key == '6') {
    if (map[x1+1][y1] == 1 || map[x1+1][y1] == 2 || map[x1+1][y1] == 3 || map[x1+1][y1] == 4 || map[x1+1][y1] == 5 || map[x1+1][y1] == 6 || map[x1+1][y1] == 7 || map[x1+1][y1] == 8 || map[x1+1][y1] == 10 || map[x1+1][y1] == 11 || map[x1+1][y1] == 12) {
      droite1 = false;
    } else {
      droite1 = true;
      gauche1 = false;
      haut1 = false;
      bas1 = false;
      x1++;
    }
  }

  if (key == '4') {
    if (map[x1-1][y1] == 1 || map[x1-1][y1] == 2 || map[x1-1][y1] == 3 || map[x1-1][y1] == 4 || map[x1-1][y1] == 5 || map[x1-1][y1] == 6 || map[x1-1][y1] == 7 || map[x1-1][y1] == 8 || map[x1-1][y1] == 10 || map[x1-1][y1] == 11 || map[x1-1][y1] == 12) {
      gauche1 = false;
    } else {
      droite1 = false;
      gauche1 = true;
      haut1 = false;
      bas1 = false;
      x1--;
    }
  }








  if (key == '0') {

    if (nombreBombe1 == 1) {                      //LIMITEUR1
      if (limiteur1 == 0) {
        g1 = x1;
        h1 = y1;
        map[g1][h1] = 10;
        bomb1 = true;
        limiteur1 = limiteur1 +1;
      }
    }   


    if (nombreBombe1 == 2) {
      if (limiteur1 == 1 || limiteur1 == 0) {
        g1 = x1;
        h1 = y1;
        map[g1][h1] = 10;
        bomb1 = true;
        limiteur1 = limiteur1 +1;
      }
    }   


    if (nombreBombe1 == 3) {
      if (limiteur1 <= 2) {
        g1 = x1;
        h1 = y1;
        map[g1][h1] = 10;
        bomb1 = true;
        limiteur1 = limiteur1 +1;
      }
    }   


    if (nombreBombe1 == 4) {
      if (limiteur1 <= 3) {
        g1 = x1;
        h1 = y1;
        map[g1][h1] = 10;
        bomb1 = true;
        limiteur1 = limiteur1 +1;
      }
    }   


    if (nombreBombe1 == 5) {
      if (limiteur1 <= 4) {
        g1 = x1;
        h1 = y1;
        map[g1][h1] = 10;
        bomb1 = true;
        limiteur1 = limiteur1 +1;
      }
    }
  }
}