|
|
@ -7,6 +7,9 @@ import java.awt.BorderLayout;
|
|
|
|
import java.awt.Color;
|
|
|
|
import java.awt.Color;
|
|
|
|
|
|
|
|
|
|
|
|
import gui.Boutton;
|
|
|
|
import gui.Boutton;
|
|
|
|
|
|
|
|
import modeles.Labyrinthe;
|
|
|
|
|
|
|
|
import modeles.Menu;
|
|
|
|
|
|
|
|
import modeles.Objet;
|
|
|
|
import gui.Background;
|
|
|
|
import gui.Background;
|
|
|
|
import java.awt.Dimension;
|
|
|
|
import java.awt.Dimension;
|
|
|
|
import java.awt.FlowLayout;
|
|
|
|
import java.awt.FlowLayout;
|
|
|
@ -14,6 +17,8 @@ import java.awt.GraphicsConfiguration;
|
|
|
|
import java.awt.GridBagConstraints;
|
|
|
|
import java.awt.GridBagConstraints;
|
|
|
|
import java.awt.GridBagLayout;
|
|
|
|
import java.awt.GridBagLayout;
|
|
|
|
import java.awt.HeadlessException;
|
|
|
|
import java.awt.HeadlessException;
|
|
|
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
@ -32,9 +37,9 @@ import org.eclipse.swt.SWT;
|
|
|
|
* @author nicolas
|
|
|
|
* @author nicolas
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class jeu extends JFrame {
|
|
|
|
public class jeu extends JFrame implements ActionListener {
|
|
|
|
|
|
|
|
JButton continuer =new JButton("Continuer");
|
|
|
|
|
|
|
|
JButton nouvelle = new JButton("Nouvelle Partie");
|
|
|
|
public jeu() throws IOException {
|
|
|
|
public jeu() throws IOException {
|
|
|
|
super();
|
|
|
|
super();
|
|
|
|
build();
|
|
|
|
build();
|
|
|
@ -52,23 +57,24 @@ public class jeu extends JFrame {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
container.setLayout(new GridBagLayout());
|
|
|
|
container.setLayout(new GridBagLayout());
|
|
|
|
JButton test2 = new JButton("Nouvelle Partie");
|
|
|
|
|
|
|
|
JButton test =new JButton("Continuer");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nouvelle.addActionListener(this);
|
|
|
|
|
|
|
|
continuer.addActionListener(this);
|
|
|
|
GridBagConstraints c = new GridBagConstraints();
|
|
|
|
GridBagConstraints c = new GridBagConstraints();
|
|
|
|
c.gridx = 0;
|
|
|
|
c.gridx = 0;
|
|
|
|
c.gridy = 0;
|
|
|
|
c.gridy = 0;
|
|
|
|
container.add(test);
|
|
|
|
container.add(nouvelle);
|
|
|
|
|
|
|
|
|
|
|
|
c.gridx = 1;
|
|
|
|
c.gridx = 1;
|
|
|
|
c.gridy=0;
|
|
|
|
c.gridy=0;
|
|
|
|
container.add(test2);
|
|
|
|
container.add(continuer);
|
|
|
|
|
|
|
|
|
|
|
|
this.setContentPane(container);
|
|
|
|
this.setContentPane(container);
|
|
|
|
this.setVisible(true);
|
|
|
|
this.setVisible(true);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public JPanel buildContentPane() {
|
|
|
|
public void buildContentPane() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -77,6 +83,22 @@ public class jeu extends JFrame {
|
|
|
|
return image;
|
|
|
|
return image;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* (non-Javadoc)
|
|
|
|
|
|
|
|
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent arg0) {
|
|
|
|
|
|
|
|
Object source=arg0.getSource();
|
|
|
|
|
|
|
|
if(source==nouvelle) {
|
|
|
|
|
|
|
|
Menu menu = new Menu();
|
|
|
|
|
|
|
|
Labyrinthe lab=menu.nouvellePartie();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(source==continuer) {
|
|
|
|
|
|
|
|
Menu menu = new Menu();
|
|
|
|
|
|
|
|
Labyrinthe lab = menu.continuer();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|