@ -42,11 +42,16 @@ import org.eclipse.swt.SWT;
public class jeu extends JFrame implements ActionListener {
JButton continuer = new JButton ( "Continuer" ) ;
JButton nouvelle = new JButton ( "Nouvelle Partie" ) ;
public JeuSalle salle ;
public JPanel panel ;
public Menu menu ;
public jeu ( ) throws IOException {
super ( ) ;
build ( ) ;
this . menu = new Menu ( ) ;
}
public void build ( ) throws IOException {
@ -78,10 +83,7 @@ public class jeu extends JFrame implements ActionListener {
this . setVisible ( true ) ;
}
public void buildContentPane ( ) {
}
public BufferedImage image ( ) throws IOException {
BufferedImage image = ImageIO . read ( new File ( "/home/nicolas/eclipse-workspace/Projet_Java/JAVA/PROJET-PMT_STRI1A/test.jpg" ) ) ;
return image ;
@ -95,18 +97,33 @@ public class jeu extends JFrame implements ActionListener {
public void actionPerformed ( ActionEvent arg0 ) {
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 ( ) ;
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 ) ) ;
repaint ( ) ;
}
//menu.Menu_Marche(marche, perso, lab);
/ *
//Bug
//Personnage perso = menu.menuSelection(lab);
//System.out.println();
panel = salle . ecrire ( menu . textePerso ( lab ) ) ;
//salle.cacher(panel);
//menu.menuSelection(lab);
@ -114,21 +131,37 @@ public class jeu extends JFrame implements ActionListener {
if ( source = = continuer ) {
Menu menu = new Menu ( ) ;
Labyrinthe lab = menu . continuer ( ) ;
} * /
}
}
public Labyrinthe choix ( Object source ) {
public void choix ( Object source ) {
if ( source = = nouvelle ) {
Menu menu = new Menu ( ) ;
Labyrinthe lab = menu . nouvellePartie ( ) ;
return lab ;
System . out . println ( "1" ) ;
//menu =new Menu();
Labyrinthe lab = new Labyrinthe ( ) ;
this . menu . getJs ( ) . setLab ( lab ) ;
this . menu . menuSelection ( this . menu . getJs ( ) . getLab ( ) ) ;
}
if ( source = = nouvelle ) {
Menu menu = new Menu ( ) ;
Labyrinthe lab = menu . continuer ( ) ;
return lab ;
if ( source = = continuer ) {
System . out . println ( "2" ) ;
//menu = new Menu();
//recupMenu(menu);
//lab = menu.continuer();
//return lab;
}
return null ;
}
/ * public Menu creersalle ( ) {
salle = new Menu ( ) ;
return salle ;
} * /
public Menu getMenu ( ) {
return menu ;
}
}