Commit 554cd675 authored by Huot Mathieu's avatar Huot Mathieu

set in full screen, permanent input re-fixed, improved readme, proper game quit

parent 783b6545
################### INSTALLATION AND REQUIRED FEATURES ################### ################### INSTALLATION AND REQUIRED FEATURES ###################
This project require java 1.8. To install it on debian stable or ubuntu 14.04 see in the wiki (TODO) This project require java 1.8.
To install it on debian stable or ubuntu 14.04 see in the wiki.
Make sure to have java 1.8 : java -version.
To compile: To compile:
cd project folder cd project folder
make make
To run To run:
Graphical version:
make play
Terminal version:
make play-term
To compile and run:
Make sure to have java 1.8 : java -version Graphical version :
To play on graphical version :
make buildplay make buildplay
To play on terminal version : Terminal version :
make buildplay-term make buildplay-term
################### HOW TO PLAY ################### ################### HOW TO PLAY ###################
...@@ -79,7 +88,6 @@ This game was created between september 2015 and january 2016. ...@@ -79,7 +88,6 @@ This game was created between september 2015 and january 2016.
It was designed in a software engineering course of M1 at ENS Cachan, France. It was designed in a software engineering course of M1 at ENS Cachan, France.
The following people were the developers : The following people were the developers :
-Arrighi Emmanuel -Arrighi Emmanuel
-Aubian Guillaume
-Babonnaud William -Babonnaud William
-Beauseigneur Clément -Beauseigneur Clément
-Begel Myriam -Begel Myriam
......
...@@ -2,7 +2,8 @@ package graphics.guiSkeleton; ...@@ -2,7 +2,8 @@ package graphics.guiSkeleton;
import graphics.graphical_abstraction.GraphicsMasterAbstraction; import graphics.graphical_abstraction.GraphicsMasterAbstraction;
import graphics.graphical_abstraction.panel.PanelAbstraction; import graphics.graphical_abstraction.panel.PanelAbstraction;
import graphics.guiSkeleton.guiPanel.*; import graphics.guiSkeleton.guiPanel.GamePanel;
import graphics.guiSkeleton.guiPanel.UnitialisedGUIPanel;
import graphics.guiSkeleton.guiPanel.menuPanel.*; import graphics.guiSkeleton.guiPanel.menuPanel.*;
import graphics.guiSkeleton.guiPanel.menuPanel.characterChoice.MultiPlayer_CharacterChoicePanel; import graphics.guiSkeleton.guiPanel.menuPanel.characterChoice.MultiPlayer_CharacterChoicePanel;
import graphics.guiSkeleton.guiPanel.menuPanel.characterChoice.SinglePlayer_CharacterChoicePanel; import graphics.guiSkeleton.guiPanel.menuPanel.characterChoice.SinglePlayer_CharacterChoicePanel;
...@@ -13,9 +14,11 @@ import graphics.guiSkeleton.guiPanel.menuPanel.gameLoad.SinglePlayer_LoadGamePan ...@@ -13,9 +14,11 @@ import graphics.guiSkeleton.guiPanel.menuPanel.gameLoad.SinglePlayer_LoadGamePan
import graphics.guiSkeleton.guiPanel.menuPanel.multiPlayer_MenuPanel.MultiPlayer_MenuPanel; import graphics.guiSkeleton.guiPanel.menuPanel.multiPlayer_MenuPanel.MultiPlayer_MenuPanel;
import graphics.guiSkeleton.guiPanel.menuPanel.multiPlayer_MenuPanel.SeverCreatedPanel; import graphics.guiSkeleton.guiPanel.menuPanel.multiPlayer_MenuPanel.SeverCreatedPanel;
import graphics.guiSkeleton.inputManagement.MainFrameKeyListener; import graphics.guiSkeleton.inputManagement.MainFrameKeyListener;
import graphics.ingame_input_listener.InputConfiguration;
import ingame_programming.IGPpanel; import ingame_programming.IGPpanel;
import javax.swing.*; import javax.swing.*;
import java.awt.event.WindowEvent;
/** /**
* Created by dupriez on 10/11/15. * Created by dupriez on 10/11/15.
...@@ -33,13 +36,10 @@ public class GraphicsMaster extends GraphicsMasterAbstraction { ...@@ -33,13 +36,10 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
// instantiated a second time by mistake) // instantiated a second time by mistake)
/** Singleton pattern implementation **/ /** Singleton pattern implementation **/
//private static GraphicsMaster thisGraphicsMaster private MainFrame mainFrame;
//protected MainFrame mainFrame;
//protected static GraphicsMasterAbstraction thisGraphicsMaster = new GraphicsMaster();
private GraphicsMaster() { private GraphicsMaster() {
//this.thisGraphicsMaster = new GraphicsMaster(); super.mainFrame=mainFrame;
mapGUIStatesToGUIPanel.put(GUIStates.UNINITIALISED, new UnitialisedGUIPanel(this)); mapGUIStatesToGUIPanel.put(GUIStates.UNINITIALISED, new UnitialisedGUIPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.MAIN_MENU, new MainMenuPanel(this)); mapGUIStatesToGUIPanel.put(GUIStates.MAIN_MENU, new MainMenuPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.GAME_PANEL, new GamePanel(this)); mapGUIStatesToGUIPanel.put(GUIStates.GAME_PANEL, new GamePanel(this));
...@@ -85,12 +85,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction { ...@@ -85,12 +85,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
public void run() { public void run() {
mainFrame = new MainFrame(); mainFrame = new MainFrame();
mainFrame.init(mainFrameKeyListener); mainFrame.init(mainFrameKeyListener);
//MainFrame mf = (MainFrame)mainFrame;
//mf.setFocusable(true); //For the keyListener to work
//mf.addKeyListener(mainFrameKeyListener);
//mf.revalidate();
//mf.setVisible(true);
changeGUIStateTo(GUIStates.MAIN_MENU); changeGUIStateTo(GUIStates.MAIN_MENU);
} }
}); });
...@@ -107,10 +101,8 @@ public class GraphicsMaster extends GraphicsMasterAbstraction { ...@@ -107,10 +101,8 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
*/ */
@Override @Override
public void exitGUI() { public void exitGUI() {
((MainFrame)mainFrame).setVisible(false); InputConfiguration.UpdateConfigurationWhenGameLeaves();
//Maybe "dispose" is not as definitive as the method exitGUI() should be mainFrame.dispatchEvent(new WindowEvent(mainFrame, WindowEvent.WINDOW_CLOSING));
((MainFrame)mainFrame).dispose();
//TODO: make it terminates the program
} }
/** /**
...@@ -134,8 +126,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction { ...@@ -134,8 +126,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
private void setGUIStateTo(GUIStates arg_guiState) { private void setGUIStateTo(GUIStates arg_guiState) {
PanelAbstraction guiPanelToDisplay = mapGUIStatesToGUIPanel.get(arg_guiState); PanelAbstraction guiPanelToDisplay = mapGUIStatesToGUIPanel.get(arg_guiState);
mainFrame.add(guiPanelToDisplay); mainFrame.add(guiPanelToDisplay);
//mainFrame.revalidate();
//mainFrame.repaint();
guiPanelToDisplay.initialise(); guiPanelToDisplay.initialise();
guiState = arg_guiState; guiState = arg_guiState;
} }
......
...@@ -19,10 +19,10 @@ public class MainFrame extends JFrame implements FrameAbstraction { ...@@ -19,10 +19,10 @@ public class MainFrame extends JFrame implements FrameAbstraction {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public MainFrame() { public MainFrame() {
//Annoying for network tests //Annoying for network tests
// setInFullScreen(); setInFullScreen();
setSize(new Dimension(500,500)); // setSize(new Dimension(500,500));
// setResizable(false); setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
RepaintTimer.getInstance().setMainFrameToRepaint(this); RepaintTimer.getInstance().setMainFrameToRepaint(this);
try { try {
......
...@@ -31,8 +31,6 @@ public class RepaintTimer { ...@@ -31,8 +31,6 @@ public class RepaintTimer {
int i = 0; int i = 0;
private int PLAYING_FRAMERATE = 33; // unit: ms private int PLAYING_FRAMERATE = 33; // unit: ms
///TODO not used ?
// private int COOL_FRAMERATE = 5000; // unit: ms
private boolean mainFrameToRepaintSet = false; private boolean mainFrameToRepaintSet = false;
private MainFrame mainFrameToRepaint; private MainFrame mainFrameToRepaint;
// the java Timer the class RepaintTimer uses // the java Timer the class RepaintTimer uses
...@@ -63,10 +61,6 @@ public class RepaintTimer { ...@@ -63,10 +61,6 @@ public class RepaintTimer {
* Set the delay of the RepaintTimer to PLAYING_FRAMERATE * Set the delay of the RepaintTimer to PLAYING_FRAMERATE
*/ */
public void enterPlayingFramerateMode() { public void enterPlayingFramerateMode() {
//swingTimer.setDelay(PLAYING_FRAMERATE);
// //TODO: should maybe restart the timer here
// swingTimer.restart();
if(debug){LOGGER.info("playingFramerateMode entered");} if(debug){LOGGER.info("playingFramerateMode entered");}
swingTimer = new javax.swing.Timer(PLAYING_FRAMERATE, repaintActionListener); swingTimer = new javax.swing.Timer(PLAYING_FRAMERATE, repaintActionListener);
...@@ -77,9 +71,6 @@ public class RepaintTimer { ...@@ -77,9 +71,6 @@ public class RepaintTimer {
* Set the delay of the RepaintTimer to COOL_FRAMERATE * Set the delay of the RepaintTimer to COOL_FRAMERATE
*/ */
public void exitPlayingFrameRateMode() { public void exitPlayingFrameRateMode() {
// swingTimer.setDelay(COOL_FRAMERATE);
// //TODO: should maybe restart the timer here
// swingTimer.restart();
if(debug){LOGGER.info("playingFramerateMode exited");} if(debug){LOGGER.info("playingFramerateMode exited");}
swingTimer.stop(); swingTimer.stop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment