Makefile ok (une dependance circulaire)
This commit is contained in:
parent
207d986890
commit
59d32b55b9
@ -1,5 +1,6 @@
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.awt.event.*;
|
||||||
|
|
||||||
public class Banniere extends JPanel {
|
public class Banniere extends JPanel {
|
||||||
private FrameJeu fenetre;
|
private FrameJeu fenetre;
|
||||||
@ -25,24 +26,19 @@ public class Banniere extends JPanel {
|
|||||||
public void setVictoire(){
|
public void setVictoire(){
|
||||||
this.add(new Fin("Victoire !",this.getSize()));
|
this.add(new Fin("Victoire !",this.getSize()));
|
||||||
this.repaint();
|
this.repaint();
|
||||||
try {
|
ActionListener backToMenu = new MenuListener(this.fenetre);
|
||||||
Thread.sleep(5000);
|
Timer timerMenu = new Timer(5000, backToMenu);
|
||||||
} catch (InterruptedException e){
|
timerMenu.setRepeats(false);
|
||||||
System.out.println("oops you didn't see the end");
|
timerMenu.start();
|
||||||
}
|
|
||||||
new FrameMenu();
|
|
||||||
this.fenetre.dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Méthode pour indiquer au joueur sa Défaite
|
// Méthode pour indiquer au joueur sa Défaite
|
||||||
public void setDefaite(){
|
public void setDefaite(){
|
||||||
this.add(new Fin("Défaite !",this.getSize()));
|
this.add(new Fin("Défaite !",this.getSize()));
|
||||||
this.repaint();try {
|
this.repaint();
|
||||||
Thread.sleep(5000);
|
ActionListener backToMenu = new MenuListener(this.fenetre);
|
||||||
} catch (InterruptedException e){
|
Timer timerMenu = new Timer(5000, backToMenu);
|
||||||
System.out.println("oops you didn't see the end");
|
timerMenu.setRepeats(false);
|
||||||
}
|
timerMenu.start();
|
||||||
new FrameMenu();
|
|
||||||
this.fenetre.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,9 +21,9 @@ public class FrameMenu extends JFrame{
|
|||||||
|
|
||||||
// On crée ensuite notre fenêtre
|
// On crée ensuite notre fenêtre
|
||||||
this.setTitle("Démineur - Menu");
|
this.setTitle("Démineur - Menu");
|
||||||
Dimension frameSize = new Dimension (screenSize.width * 3/5,screenSize.height * 2/3);
|
Dimension frameSize = new Dimension (screenSize.width *2/5,screenSize.height * 2/3);
|
||||||
this.setSize(frameSize);
|
this.setSize(frameSize);
|
||||||
this.setLocation(screenSize.width * 1/5, screenSize.height * 1/6);
|
this.setLocation(screenSize.width * 3/10, screenSize.height * 1/6);
|
||||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
this.setLayout(null);
|
this.setLayout(null);
|
||||||
|
|
||||||
@ -41,9 +41,9 @@ public class FrameMenu extends JFrame{
|
|||||||
this.colonnes=sliderColonnes.getValue();
|
this.colonnes=sliderColonnes.getValue();
|
||||||
this.mines=sliderMines.getValue();
|
this.mines=sliderMines.getValue();
|
||||||
|
|
||||||
sliderLignes.setBounds(frameSize.width*2/3, frameSize.height*6/15, frameSize.width/4, frameSize.height/20);
|
sliderLignes.setBounds(frameSize.width*3/5, frameSize.height*6/15, frameSize.width/3, frameSize.height/20);
|
||||||
sliderColonnes.setBounds(frameSize.width*2/3, frameSize.height*8/15, frameSize.width/4, frameSize.height/20);
|
sliderColonnes.setBounds(frameSize.width*3/5, frameSize.height*8/15, frameSize.width/3, frameSize.height/20);
|
||||||
sliderMines.setBounds(frameSize.width*2/3, frameSize.height*10/15, frameSize.width/4, frameSize.height/20);
|
sliderMines.setBounds(frameSize.width*3/5, frameSize.height*10/15, frameSize.width/3, frameSize.height/20);
|
||||||
|
|
||||||
this.add(sliderLignes);
|
this.add(sliderLignes);
|
||||||
this.add(sliderColonnes);
|
this.add(sliderColonnes);
|
||||||
@ -53,9 +53,9 @@ public class FrameMenu extends JFrame{
|
|||||||
this.showColumns= new JLabel("Colonnes : 25");
|
this.showColumns= new JLabel("Colonnes : 25");
|
||||||
this.showMines= new JLabel("Mines : 50");
|
this.showMines= new JLabel("Mines : 50");
|
||||||
|
|
||||||
this.showLines.setBounds(frameSize.width*2/3, frameSize.height*7/15, frameSize.width/4, frameSize.height/20);
|
this.showLines.setBounds(frameSize.width*3/5, frameSize.height*5/15, frameSize.width/3, frameSize.height/20);
|
||||||
this.showColumns.setBounds(frameSize.width*2/3, frameSize.height*9/15, frameSize.width/4, frameSize.height/20);
|
this.showColumns.setBounds(frameSize.width*3/5, frameSize.height*7/15, frameSize.width/3, frameSize.height/20);
|
||||||
this.showMines.setBounds(frameSize.width*2/3, frameSize.height*11/15, frameSize.width/4, frameSize.height/20);
|
this.showMines.setBounds(frameSize.width*3/5, frameSize.height*9/15, frameSize.width/3, frameSize.height/20);
|
||||||
|
|
||||||
this.add(showLines);
|
this.add(showLines);
|
||||||
this.add(showColumns);
|
this.add(showColumns);
|
||||||
@ -64,7 +64,7 @@ public class FrameMenu extends JFrame{
|
|||||||
JButton newGame = new JButton("New Game");
|
JButton newGame = new JButton("New Game");
|
||||||
newGame.addActionListener(new NewGameListener(this));
|
newGame.addActionListener(new NewGameListener(this));
|
||||||
|
|
||||||
newGame.setBounds(frameSize.width*3/5, frameSize.height*12/15, frameSize.width/8, frameSize.height/15);;
|
newGame.setBounds(frameSize.width*3/5, frameSize.height*12/15, frameSize.width/5, frameSize.height/15);;
|
||||||
this.add(newGame);
|
this.add(newGame);
|
||||||
|
|
||||||
JButton exit = new JButton("Quitter");
|
JButton exit = new JButton("Quitter");
|
||||||
@ -74,10 +74,11 @@ public class FrameMenu extends JFrame{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
exit.setBounds(frameSize.width/10, frameSize.height*12/15, frameSize.width/8, frameSize.height/15);
|
exit.setBounds(frameSize.width/10, frameSize.height*12/15, frameSize.width/5, frameSize.height/15);
|
||||||
this.add(exit);
|
this.add(exit);
|
||||||
|
|
||||||
//TODO : Bouton charger
|
//TODO : Bouton charger
|
||||||
|
this.setResizable(false);
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,6 @@ public class Grille extends JPanel{
|
|||||||
if (taille-mines==casesVisibles){
|
if (taille-mines==casesVisibles){
|
||||||
for (int i=0;i<taille;i++){
|
for (int i=0;i<taille;i++){
|
||||||
this.plateau[i].setVictoire();
|
this.plateau[i].setVictoire();
|
||||||
System.out.println("Victoire !");
|
|
||||||
}
|
}
|
||||||
this.banniere.setVictoire();
|
this.banniere.setVictoire();
|
||||||
}
|
}
|
||||||
@ -198,7 +197,6 @@ public class Grille extends JPanel{
|
|||||||
// Montre toutes les cases du plateau
|
// Montre toutes les cases du plateau
|
||||||
for (int i=0;i<this.taille;i++){
|
for (int i=0;i<this.taille;i++){
|
||||||
this.plateau[i].setVisible();
|
this.plateau[i].setVisible();
|
||||||
System.out.println("Défaite !");
|
|
||||||
}
|
}
|
||||||
this.banniere.setDefaite();
|
this.banniere.setDefaite();
|
||||||
}
|
}
|
||||||
|
49
Makefile
49
Makefile
@ -8,14 +8,53 @@ JVMFLAGS =
|
|||||||
|
|
||||||
### REGLES ESSENTIELLES ###
|
### REGLES ESSENTIELLES ###
|
||||||
|
|
||||||
Main.class : Main.java Fenetre.class
|
Main.class : Main.java FrameMenu.class
|
||||||
${JC} ${JCFLAGS} Main.java
|
${JC} ${JCFLAGS} Main.java
|
||||||
|
|
||||||
Fenetre.class : Fenetre.java Controleur.class
|
FrameMenu.class : FrameMenu.java SettingsListener.class NewGameListener.class
|
||||||
${JC} ${JCFLAGS} Fenetre.java
|
${JC} ${JCFLAGS} FrameMenu.java
|
||||||
|
|
||||||
|
SettingsListener.class : SettingsListener.java
|
||||||
|
${JC} ${JCFLAGS} SettingsListener.java
|
||||||
|
|
||||||
|
NewGameListener.class : NewGameListener.java FrameJeu.class
|
||||||
|
${JC} ${JCFLAGS} NewGameListener.java
|
||||||
|
|
||||||
|
FrameJeu.class : FrameJeu.java Grille.class
|
||||||
|
${JC} ${JCFLAGS} FrameJeu.java
|
||||||
|
|
||||||
|
Grille.class : Grille.java Banniere.class Case.class
|
||||||
|
${JC} ${JCFLAGS} Grille.java
|
||||||
|
|
||||||
|
Banniere.class : Banniere.java MineLeft.class MenuListener.class Fin.class
|
||||||
|
${JC} ${JCFLAGS} Banniere.java
|
||||||
|
|
||||||
|
Case.class : Case.java ListenerCase.class Entourage.class
|
||||||
|
${JC} ${JCFLAGS} Case.java
|
||||||
|
|
||||||
|
MineLeft.class : MineLeft.java
|
||||||
|
${JC} ${JCFLAGS} MineLeft.java
|
||||||
|
|
||||||
|
Fin.class : Fin.java
|
||||||
|
${JC} ${JCFLAGS} Fin.java
|
||||||
|
|
||||||
|
MenuListener.class : MenuListener.java FrameMenu.class
|
||||||
|
${JC} ${JCFLAGS} MenuListener.java
|
||||||
|
|
||||||
|
ListenerCase.class : ListenerCase.java Etoile.class Doute.class
|
||||||
|
${JC} ${JCFLAGS} ListenerCase.java
|
||||||
|
|
||||||
|
Entourage.class : Entourage.java
|
||||||
|
${JC} ${JCFLAGS} Entourage.java
|
||||||
|
|
||||||
|
Etoile.class : Etoile.java
|
||||||
|
${JC} ${JCFLAGS} Etoile.java
|
||||||
|
|
||||||
|
Doute.class : Doute.java
|
||||||
|
${JC} ${JCFLAGS} Doute.java
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Controleur.class : Controleur.java
|
|
||||||
${JC} ${JCFLAGS} Controleur.java
|
|
||||||
|
|
||||||
### REGLES OPTIONNELLES ###
|
### REGLES OPTIONNELLES ###
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user