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 ###################
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:
cd project folder
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
To play on graphical version :
Graphical version :
make buildplay
To play on terminal version :
Terminal version :
make buildplay-term
################### HOW TO PLAY ###################
......@@ -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.
The following people were the developers :
-Arrighi Emmanuel
-Aubian Guillaume
-Babonnaud William
-Beauseigneur Clément
-Begel Myriam
......
......@@ -2,7 +2,8 @@ package graphics.guiSkeleton;
import graphics.graphical_abstraction.GraphicsMasterAbstraction;
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.characterChoice.MultiPlayer_CharacterChoicePanel;
import graphics.guiSkeleton.guiPanel.menuPanel.characterChoice.SinglePlayer_CharacterChoicePanel;
......@@ -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.SeverCreatedPanel;
import graphics.guiSkeleton.inputManagement.MainFrameKeyListener;
import graphics.ingame_input_listener.InputConfiguration;
import ingame_programming.IGPpanel;
import javax.swing.*;
import java.awt.event.WindowEvent;
/**
* Created by dupriez on 10/11/15.
......@@ -33,13 +36,10 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
// instantiated a second time by mistake)
/** Singleton pattern implementation **/
//private static GraphicsMaster thisGraphicsMaster
//protected MainFrame mainFrame;
//protected static GraphicsMasterAbstraction thisGraphicsMaster = new GraphicsMaster();
private MainFrame mainFrame;
private GraphicsMaster() {
//this.thisGraphicsMaster = new GraphicsMaster();
super.mainFrame=mainFrame;
mapGUIStatesToGUIPanel.put(GUIStates.UNINITIALISED, new UnitialisedGUIPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.MAIN_MENU, new MainMenuPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.GAME_PANEL, new GamePanel(this));
......@@ -85,12 +85,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
public void run() {
mainFrame = new MainFrame();
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);
}
});
......@@ -107,10 +101,8 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
*/
@Override
public void exitGUI() {
((MainFrame)mainFrame).setVisible(false);
//Maybe "dispose" is not as definitive as the method exitGUI() should be
((MainFrame)mainFrame).dispose();
//TODO: make it terminates the program
InputConfiguration.UpdateConfigurationWhenGameLeaves();
mainFrame.dispatchEvent(new WindowEvent(mainFrame, WindowEvent.WINDOW_CLOSING));
}
/**
......@@ -134,8 +126,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
private void setGUIStateTo(GUIStates arg_guiState) {
PanelAbstraction guiPanelToDisplay = mapGUIStatesToGUIPanel.get(arg_guiState);
mainFrame.add(guiPanelToDisplay);
//mainFrame.revalidate();
//mainFrame.repaint();
guiPanelToDisplay.initialise();
guiState = arg_guiState;
}
......
......@@ -19,10 +19,10 @@ public class MainFrame extends JFrame implements FrameAbstraction {
private static final long serialVersionUID = 1L;
public MainFrame() {
//Annoying for network tests
// setInFullScreen();
setSize(new Dimension(500,500));
setInFullScreen();
// setSize(new Dimension(500,500));
// setResizable(false);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
RepaintTimer.getInstance().setMainFrameToRepaint(this);
try {
......
......@@ -31,8 +31,6 @@ public class RepaintTimer {
int i = 0;
private int PLAYING_FRAMERATE = 33; // unit: ms
///TODO not used ?
// private int COOL_FRAMERATE = 5000; // unit: ms
private boolean mainFrameToRepaintSet = false;
private MainFrame mainFrameToRepaint;
// the java Timer the class RepaintTimer uses
......@@ -63,10 +61,6 @@ public class RepaintTimer {
* Set the delay of the RepaintTimer to PLAYING_FRAMERATE
*/
public void enterPlayingFramerateMode() {
//swingTimer.setDelay(PLAYING_FRAMERATE);
// //TODO: should maybe restart the timer here
// swingTimer.restart();
if(debug){LOGGER.info("playingFramerateMode entered");}
swingTimer = new javax.swing.Timer(PLAYING_FRAMERATE, repaintActionListener);
......@@ -77,9 +71,6 @@ public class RepaintTimer {
* Set the delay of the RepaintTimer to COOL_FRAMERATE
*/
public void exitPlayingFrameRateMode() {
// swingTimer.setDelay(COOL_FRAMERATE);
// //TODO: should maybe restart the timer here
// swingTimer.restart();
if(debug){LOGGER.info("playingFramerateMode exited");}
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