|
|
@ -42,6 +42,8 @@ import org.eclipse.swt.SWT;
|
|
|
|
public class jeu extends JFrame implements ActionListener {
|
|
|
|
public class jeu extends JFrame implements ActionListener {
|
|
|
|
JButton continuer =new JButton("Continuer");
|
|
|
|
JButton continuer =new JButton("Continuer");
|
|
|
|
JButton nouvelle = new JButton("Nouvelle Partie");
|
|
|
|
JButton nouvelle = new JButton("Nouvelle Partie");
|
|
|
|
|
|
|
|
public JeuSalle salle;
|
|
|
|
|
|
|
|
public JPanel panel;
|
|
|
|
public jeu() throws IOException {
|
|
|
|
public jeu() throws IOException {
|
|
|
|
super();
|
|
|
|
super();
|
|
|
|
build();
|
|
|
|
build();
|
|
|
@ -89,26 +91,45 @@ public class jeu extends JFrame implements ActionListener {
|
|
|
|
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
|
|
|
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent arg0) {
|
|
|
|
public void actionPerformed(ActionEvent arg0) {
|
|
|
|
Object source=arg0.getSource();
|
|
|
|
Object source=arg0.getSource();
|
|
|
|
|
|
|
|
choix(source);
|
|
|
|
if(source==nouvelle) {
|
|
|
|
if(source==nouvelle) {
|
|
|
|
|
|
|
|
//JPanel panel = new JPanel();
|
|
|
|
Menu menu = new Menu();
|
|
|
|
Menu menu = new Menu();
|
|
|
|
Labyrinthe lab=menu.nouvellePartie();
|
|
|
|
Labyrinthe lab=menu.nouvellePartie();
|
|
|
|
JeuSalle salle = new JeuSalle();
|
|
|
|
JeuSalle salle = new JeuSalle();
|
|
|
|
Marche marche= (Marche) lab.listePorte.get(0).getSalle1();
|
|
|
|
Marche marche= (Marche) lab.listePorte.get(0).getSalle1();
|
|
|
|
salle.ecrire(marche.creerObjetsAVendre(lab));
|
|
|
|
panel =salle.ecrire(marche.creerObjetsAVendre(lab));
|
|
|
|
repaint();
|
|
|
|
repaint();
|
|
|
|
//Bug
|
|
|
|
//Bug
|
|
|
|
//Personnage perso = menu.menuSelection(lab);
|
|
|
|
//Personnage perso = menu.menuSelection(lab);
|
|
|
|
//System.out.println();
|
|
|
|
//System.out.println();
|
|
|
|
salle.ecrire(menu.textePerso(lab));
|
|
|
|
panel =salle.ecrire(menu.textePerso(lab));
|
|
|
|
|
|
|
|
//salle.cacher(panel);
|
|
|
|
|
|
|
|
//menu.menuSelection(lab);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(source==continuer) {
|
|
|
|
if(source==continuer) {
|
|
|
|
Menu menu = new Menu();
|
|
|
|
Menu menu = new Menu();
|
|
|
|
Labyrinthe lab = menu.continuer();
|
|
|
|
Labyrinthe lab = menu.continuer();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Labyrinthe choix(Object source) {
|
|
|
|
|
|
|
|
if(source==nouvelle) {
|
|
|
|
|
|
|
|
Menu menu = new Menu();
|
|
|
|
|
|
|
|
Labyrinthe lab=menu.nouvellePartie();
|
|
|
|
|
|
|
|
return lab;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(source==nouvelle) {
|
|
|
|
|
|
|
|
Menu menu = new Menu();
|
|
|
|
|
|
|
|
Labyrinthe lab = menu.continuer();
|
|
|
|
|
|
|
|
return lab;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|