|
|
|
@ -49,7 +49,6 @@ public class jeu extends JFrame implements ActionListener {
|
|
|
|
|
|
|
|
|
|
public jeu() throws IOException {
|
|
|
|
|
super();
|
|
|
|
|
|
|
|
|
|
build();
|
|
|
|
|
this.menu=new Menu();
|
|
|
|
|
}
|
|
|
|
@ -61,10 +60,10 @@ public class jeu extends JFrame implements ActionListener {
|
|
|
|
|
setResizable(false);
|
|
|
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Création du JLabel pour l'image
|
|
|
|
|
JLabel container = new JLabel(new ImageIcon(this.image()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Création du layout des boutons
|
|
|
|
|
container.setLayout(new GridBagLayout());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -91,6 +90,7 @@ public class jeu extends JFrame implements ActionListener {
|
|
|
|
|
|
|
|
|
|
/* (non-Javadoc)
|
|
|
|
|
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
|
|
|
|
Récupération des évènements des boutons Nouvelle Partie et Contnuer
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
|
@ -98,52 +98,21 @@ public class jeu extends JFrame implements ActionListener {
|
|
|
|
|
Object source=arg0.getSource();
|
|
|
|
|
choix(source);
|
|
|
|
|
|
|
|
|
|
//if(source==nouvelle) {
|
|
|
|
|
//JPanel panel = new JPanel();
|
|
|
|
|
/*Menu menu = new Menu();
|
|
|
|
|
Labyrinthe lab=menu.nouvellePartie();
|
|
|
|
|
JeuSalle salle = new JeuSalle();
|
|
|
|
|
|
|
|
|
|
repaint();
|
|
|
|
|
|
|
|
|
|
Personnage perso = menu.menuSelection(lab, salle);
|
|
|
|
|
panel =salle.ecrire(menu.textePerso(lab));
|
|
|
|
|
int test =1;
|
|
|
|
|
if(perso!=null) {
|
|
|
|
|
panel.setVisible(false);
|
|
|
|
|
repaint();
|
|
|
|
|
System.out.println("test");
|
|
|
|
|
|
|
|
|
|
Marche marche= (Marche) lab.listePorte.get(0).getSalle1();
|
|
|
|
|
panel =salle.ecrire(marche.creerObjetsAVendre(lab));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//menu.Menu_Marche(marche, perso, lab);
|
|
|
|
|
/*
|
|
|
|
|
//Bug
|
|
|
|
|
|
|
|
|
|
//System.out.println();
|
|
|
|
|
|
|
|
|
|
//salle.cacher(panel);
|
|
|
|
|
//menu.menuSelection(lab);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(source==continuer) {
|
|
|
|
|
Menu menu = new Menu();
|
|
|
|
|
Labyrinthe lab = menu.continuer();
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/*Méthode de traitement des actions sur les boutons*/
|
|
|
|
|
public void choix(Object source) {
|
|
|
|
|
|
|
|
|
|
if(source==nouvelle) {
|
|
|
|
|
System.out.println("1");
|
|
|
|
|
|
|
|
|
|
//menu =new Menu();
|
|
|
|
|
//Création du Labyrinthe
|
|
|
|
|
Labyrinthe lab =new Labyrinthe();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.menu.getJs().setLab(lab) ;
|
|
|
|
|
//
|
|
|
|
|
this.menu.getJs().setLab(lab);
|
|
|
|
|
//Appel de la méthode menuSelection()
|
|
|
|
|
this.menu.menuSelection(this.menu.getJs().getLab());
|
|
|
|
|
}
|
|
|
|
|
if(source==continuer) {
|
|
|
|
@ -156,10 +125,7 @@ public class jeu extends JFrame implements ActionListener {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/* public Menu creersalle() {
|
|
|
|
|
salle = new Menu();
|
|
|
|
|
return salle;
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
public Menu getMenu() {
|
|
|
|
|
return menu;
|
|
|
|
|
}
|
|
|
|
|