Package Model

Examples of Model.Game


* Classe Main centrale
*/
public class Main {
  static public void main(String args[]) {
    Controller controller = new Controller(true);
    Game game = Game.getInstance();
    GUI gui = GUI.getInstance();

    /* Boucle de jeu */
    while (!game.isFinished()) {
      game.step();
      gui.update();
    }
    JFrame fin;
    fin = new JFrame();
    fin.setResizable(false);
    fin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    fin.pack();
    fin.setFocusable(true);
    fin.setVisible(true);
    fin.setBounds(100, 100, 200, 100);
   

    JButton b = new JButton("OK");
    b.setBounds(new Rectangle(100,100));
    b.addMouseListener(new MouseAdapter() {
     
      @Override
      public void mousePressed(MouseEvent arg0) {
        System.exit(0);
      }
    });
    if(game.win()){
      fin.setTitle("Partie Gagnée");
      fin.add(b);
    }
    else{
      fin.setTitle("Partie Perdue");
View Full Code Here

TOP

Related Classes of Model.Game

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.