modif estetique

This commit is contained in:
martins 2022-04-28 01:03:16 +02:00
parent 82795b037a
commit 7bbb4a8dee
6 changed files with 8 additions and 18 deletions

Binary file not shown.

View File

@ -11,13 +11,15 @@ public class Case extends JComponent{
private boolean bombe; private boolean bombe;
private int voisin; private int voisin;
private int suspition; private int suspition;
private Image interogation; private Image interogation, etoile, imgboombe;
public Case(){ public Case(){
this.visibilite=false; this.visibilite=false;
this.bombe=false; this.bombe=false;
this.voisin=0; this.voisin=0;
this.suspition=0; this.suspition=0;
this.interogation= Toolkit.getDefaultToolkit().getImage("./IMAGE/pointintero.png"); 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){ public void setVisibiliter(boolean trueorfalse){
this.visibilite=trueorfalse; this.visibilite=trueorfalse;
@ -72,27 +74,15 @@ public class Case extends JComponent{
} }
if(this.suspition==1 && this.visibilite==false){ if(this.suspition==1 && this.visibilite==false){
int[] x = new int[5]; secondPinceau.drawImage(this.etoile, this.getWidth()/20*5, this.getHeight()/20*5, this.getWidth()/20*10, this.getHeight()/20*10 ,this);
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);
} }
if(this.suspition==2 && this.visibilite==false){ 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){ if(this.bombe==true && this.visibilite==true){
secondPinceau.setColor(new Color(255,0,125)); 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);
} }
} }
} }

BIN
CASE/IMAGE/bombe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
CASE/IMAGE/etoile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

View File

@ -12,7 +12,7 @@ public class main_ex{
JFrame fenetre = new JFrame("Démineur"); JFrame fenetre = new JFrame("Démineur");
fenetre.setLocation(0,0); fenetre.setLocation(0,0);
//on choisi une taille arbitraire //on choisi une taille arbitraire
fenetre.setSize(1030,800); fenetre.setSize(1500,800);
//nous utiliserons un gestionnaire GridLayout //nous utiliserons un gestionnaire GridLayout
GridLayout grille = new GridLayout(14,8); GridLayout grille = new GridLayout(14,8);
fenetre.setLayout(grille); fenetre.setLayout(grille);