diff --git a/CASE/Case.class b/CASE/Case.class index 81cb658..91cfb37 100644 Binary files a/CASE/Case.class and b/CASE/Case.class differ diff --git a/CASE/Case.java b/CASE/Case.java index b1d1d56..2f4c21b 100644 --- a/CASE/Case.java +++ b/CASE/Case.java @@ -13,7 +13,7 @@ public class Case extends JComponent{ private int voisin; //Le nombre de mine aux alentours private int suspition; // son Etat de suspition ( 0:pas une bombe, 1:en est une, 2:je doute) // Les Images de la case (point d'interogation, etoile et bombe) - private Image interogation, etoile, imgboombe; + private Image interogation, etoile, imgboombe, un, deux, trois, quatre, cinq, six, sept, huit; //Constructeur de la Case public Case(){ @@ -27,6 +27,14 @@ public class Case extends JComponent{ this.interogation= Toolkit.getDefaultToolkit().getImage("./IMAGE/pointintero.png"); this.etoile= Toolkit.getDefaultToolkit().getImage("./IMAGE/etoile.png"); this.imgboombe= Toolkit.getDefaultToolkit().getImage("./IMAGE/bombe.png"); + this.un=Toolkit.getDefaultToolkit().getImage("./IMAGE/un.jpg"); + this.deux=Toolkit.getDefaultToolkit().getImage("./IMAGE/deux.jpg"); + this.trois=Toolkit.getDefaultToolkit().getImage("./IMAGE/trois.jpg"); + this.quatre=Toolkit.getDefaultToolkit().getImage("./IMAGE/quatre.jpg"); + this.cinq=Toolkit.getDefaultToolkit().getImage("./IMAGE/cinq.jpg"); + this.six=Toolkit.getDefaultToolkit().getImage("./IMAGE/six.jpg"); + this.sept=Toolkit.getDefaultToolkit().getImage("./IMAGE/sept.jpg"); + this.huit=Toolkit.getDefaultToolkit().getImage("./IMAGE/huit.jpg"); } // Nous mettons les getter/setter @@ -112,7 +120,30 @@ public class Case extends JComponent{ //si la case a au moins 1 voisin qui est une bombe if(this.voisin>0){ //on ecrit le nombre de voisin que elle a - secondPinceau.drawString(String.valueOf(voisin), this.getWidth()/2, this.getHeight()/2); + if(this.voisin==1){ + secondPinceau.drawImage(this.un, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); + } + if(this.voisin==2){ + secondPinceau.drawImage(this.deux, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); + } + if(this.voisin==3){ + secondPinceau.drawImage(this.trois, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); + } + if(this.voisin==4){ + secondPinceau.drawImage(this.quatre, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); + } + if(this.voisin==5){ + secondPinceau.drawImage(this.cinq, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); + } + if(this.voisin==6){ + secondPinceau.drawImage(this.six, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); + } + if(this.voisin==7){ + secondPinceau.drawImage(this.sept, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); + } + if(this.voisin==8){ + secondPinceau.drawImage(this.huit, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); + } } //si la case est une bombe if(this.bombe==true){ diff --git a/CASE/IMAGE/cinq.jpg b/CASE/IMAGE/cinq.jpg new file mode 100644 index 0000000..b828d77 Binary files /dev/null and b/CASE/IMAGE/cinq.jpg differ diff --git a/CASE/IMAGE/deux.jpg b/CASE/IMAGE/deux.jpg new file mode 100644 index 0000000..ff2c305 Binary files /dev/null and b/CASE/IMAGE/deux.jpg differ diff --git a/CASE/IMAGE/huit.jpg b/CASE/IMAGE/huit.jpg new file mode 100644 index 0000000..9c681d7 Binary files /dev/null and b/CASE/IMAGE/huit.jpg differ diff --git a/CASE/IMAGE/quatre.jpg b/CASE/IMAGE/quatre.jpg new file mode 100644 index 0000000..ae4d002 Binary files /dev/null and b/CASE/IMAGE/quatre.jpg differ diff --git a/CASE/IMAGE/sept.jpg b/CASE/IMAGE/sept.jpg new file mode 100644 index 0000000..d6841fd Binary files /dev/null and b/CASE/IMAGE/sept.jpg differ diff --git a/CASE/IMAGE/six.jpg b/CASE/IMAGE/six.jpg new file mode 100644 index 0000000..f84ef83 Binary files /dev/null and b/CASE/IMAGE/six.jpg differ diff --git a/CASE/IMAGE/trois.jpg b/CASE/IMAGE/trois.jpg new file mode 100644 index 0000000..30b0737 Binary files /dev/null and b/CASE/IMAGE/trois.jpg differ diff --git a/CASE/IMAGE/un.jpg b/CASE/IMAGE/un.jpg new file mode 100644 index 0000000..2a2e75e Binary files /dev/null and b/CASE/IMAGE/un.jpg differ diff --git a/CASE/main_ex.class b/CASE/main_ex.class index 7bf11f8..bedb617 100644 Binary files a/CASE/main_ex.class and b/CASE/main_ex.class differ diff --git a/CASE/main_ex.java b/CASE/main_ex.java index e170066..1a00484 100644 --- a/CASE/main_ex.java +++ b/CASE/main_ex.java @@ -10,8 +10,8 @@ public class main_ex{ public static void main(String[] Args){ // on initialise une fenettre JFrame fenetre = new JFrame("Démineur"); - int ligne=8; - int collonne=10; + int ligne=30; + int collonne=80; fenetre.setLocation(0,0); //on choisi une taille arbitraire fenetre.setSize(1500,800); @@ -33,7 +33,7 @@ public class main_ex{ } } //nous disposons les bombe dans le jeu - plateau.setAllBombe(8, ligne, collonne, tab); + plateau.setAllBombe(300, ligne, collonne, tab); //maitenant que les bombe sont mise nous pouvons modifier le nombre de voisin des cases plateau.setAllVoisin(tab); }