modif estetique
This commit is contained in:
parent
82795b037a
commit
7bbb4a8dee
BIN
CASE/Case.class
BIN
CASE/Case.class
Binary file not shown.
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
BIN
CASE/IMAGE/bombe.png
Normal file
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
BIN
CASE/IMAGE/etoile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user