Skip to content
Snippets Groups Projects
Commit a2c12cbc authored by Azurlors's avatar Azurlors
Browse files

début menu

parent 75cb0972
Branches master
No related tags found
No related merge requests found
package engine;
import javax.swing.*;
public class MenuPanel {
private boolean lancementpartie = false;
private final JButton button;
public boolean isLancementpartie() {
return lancementpartie;
}
public MenuPanel(){
JFrame f=new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.button = new JButton("Nouvelle partie");
JPanel panel = new JPanel();
panel.add(button);
f.getContentPane().add(panel);
f.pack();
f.setVisible(true);
f.getContentPane().setFocusable(true);
}
public void waitlancementpartie(){
button.addActionListener(e -> lancementpartie = true);
}
}
package start;
import engine.MenuPanel;
import jeu.Painter;
import spotify.MP3;
......@@ -18,6 +19,12 @@ public class Main {
Jeu game = new Jeu("helpFilePacman.txt");
Painter painter = new Painter();
Controller controller = new Controller();
//creation du menu
MenuPanel menu = new MenuPanel();
while(!menu.isLancementpartie()){
menu.waitlancementpartie();
}
//pour la musique
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment