diff --git a/CASE/Case.class b/CASE/Case.class index ed82625..8dbc20f 100644 Binary files a/CASE/Case.class and b/CASE/Case.class differ diff --git a/CASE/Case.java b/CASE/Case.java index a039bb3..167e530 100644 --- a/CASE/Case.java +++ b/CASE/Case.java @@ -11,13 +11,15 @@ public class Case extends JComponent{ private boolean bombe; private int voisin; private int suspition; - private Image interogation; + private Image interogation, etoile, imgboombe; public Case(){ this.visibilite=false; this.bombe=false; this.voisin=0; this.suspition=0; this.interogation= Toolkit.getDefaultToolkit().getImage("./IMAGE/pointintero.png"); + this.etoile= Toolkit.getDefaultToolkit().getImage("./IMAGE/etoile.png"); + this.imgboombe= Toolkit.getDefaultToolkit().getImage("./IMAGE/bombe.png"); } public void setVisibiliter(boolean trueorfalse){ this.visibilite=trueorfalse; @@ -72,27 +74,15 @@ public class Case extends JComponent{ } if(this.suspition==1 && this.visibilite==false){ - int[] x = new int[5]; - int[] y = new int[5]; - x[0]=this.getWidth()/2; - x[1]=this.getWidth()/10*9; - x[2]=this.getWidth()/10*7; - x[3]=this.getWidth()/10*3; - x[4]=this.getWidth()/10; - y[0]=this.getHeight()/10*2; - y[1]=this.getHeight()/2; - y[2]=this.getHeight()/10*8; - y[3]=this.getHeight()/10*8; - y[4]=this.getHeight()/2; - secondPinceau.setColor(new Color(255,0,125)); - secondPinceau.fillPolygon(x, y, 5); + secondPinceau.drawImage(this.etoile, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); } if(this.suspition==2 && this.visibilite==false){ - secondPinceau.drawImage(this.interogation, this.getWidth()/10, this.getHeight()/10, this.getWidth()/10*5, this.getHeight()/10*5 ,this); + secondPinceau.drawImage(this.interogation, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); } if(this.bombe==true && this.visibilite==true){ secondPinceau.setColor(new Color(255,0,125)); - secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + secondPinceau.fillRect(this.getWidth()/20, this.getHeight()/20, this.getWidth()/20*18, this.getHeight()/20*18); + secondPinceau.drawImage(this.imgboombe, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this); } } } \ No newline at end of file diff --git a/CASE/IMAGE/bombe.png b/CASE/IMAGE/bombe.png new file mode 100644 index 0000000..60fc420 Binary files /dev/null and b/CASE/IMAGE/bombe.png differ diff --git a/CASE/IMAGE/etoile.png b/CASE/IMAGE/etoile.png new file mode 100644 index 0000000..66964aa Binary files /dev/null and b/CASE/IMAGE/etoile.png differ diff --git a/CASE/main_ex.class b/CASE/main_ex.class index f6623ec..c21b85b 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 ff69f1a..1087e33 100644 --- a/CASE/main_ex.java +++ b/CASE/main_ex.java @@ -12,7 +12,7 @@ public class main_ex{ JFrame fenetre = new JFrame("Démineur"); fenetre.setLocation(0,0); //on choisi une taille arbitraire - fenetre.setSize(1030,800); + fenetre.setSize(1500,800); //nous utiliserons un gestionnaire GridLayout GridLayout grille = new GridLayout(14,8); fenetre.setLayout(grille);