Commit ba05a50b authored by Ghyselen's avatar Ghyselen

Merge gitlab.crans.org:genie_logiciel_2015/the_dungeon_project

parents f566545c 45a761dd
...@@ -13,13 +13,31 @@ To run ...@@ -13,13 +13,31 @@ To run
################### HOW TO PLAY ################### ################### HOW TO PLAY ###################
1)Launch the game. 2)On the main panel, you may : 2.1) single player : starts the game in a single player mode 2.2) multi player : TODO 2.3) configuration : you may configure the keys used to play the game 2.4) IGP : stands for "in game programming" : you may configure your own A.I. for the game 2.5) exit : leaves the game 1)Launch the game.
3)Once you are in game : For now, the basic configuration is : Move left : left_arrow Move right : right_arrow Move up : up_arrow Move down : down_arrow Attack : a Spell : s Back to main : escape 2)On the main panel, you may :
2.1) single player : starts the game in a single player mode
2.2) multi player : enables to create/join a multi player mode
2.3) configuration : you may configure the keys used to play the game
2.4) IGP : stands for "in game programming" : you may configure your own A.I. for your game allies
2.5) exit : leaves the game : be careful configuration keys are not registered
3)Default commands:
-Move left : left_arrow
-Move right : right_arrow
-Move up : up_arrow
-Move down : down_arrow
-Attack : a
-Ability1 : z
-Ability1 : e
-Ability1 : r
-Back to main : escape
################### HOW TO DOCUMENT ################### ################### HOW TO DOCUMENT ###################
To document the project, you need the package doxygen. It will create a HTML documentation from the code. To have inheritance graphs, please install graphivz. To document the project, you need the package doxygen.
It will create a HTML documentation from the code.
To have inheritance graphs, please install graphivz.
English versions : English versions :
...@@ -37,26 +55,6 @@ Without graphivz ...@@ -37,26 +55,6 @@ Without graphivz
make doc-html2-fr make doc-html2-fr
################### HOW TO PLAY ###################
1)Launch the game.
2)On the main panel, you may :
2.1) single player : starts the game in a single player mode
2.2) multi player : TODO
2.3) configuration : you may configure the keys used to play the game
2.4) IGP : stands for "in game programming" : you may configure your own A.I. for the game
2.5) exit : leaves the game
3)Once you are in game :
For now, the basic configuration is :
Move left : left_arrow
Move right : right_arrow
Move up : up_arrow
Move down : down_arrow
Attack : a
Spell : s
Back to main : escape
################### PRINCIPLE OF THE GAME ################### ################### PRINCIPLE OF THE GAME ###################
TODO TODO
...@@ -87,6 +85,4 @@ The following people were the developers : ...@@ -87,6 +85,4 @@ The following people were the developers :
-Ringeade Clément -Ringeade Clément
-Toussaint Etienne -Toussaint Etienne
-Thomas Colin -Thomas Colin
-Ursu Bogdan -Ursu Bogdan
\ No newline at end of file
TODO : missing names to fill because not registered
package graphics.graphical_abstraction.panel.menu;
import graphics.guiSkeleton.GUIColorsAndFonts;
import graphics.guiSkeleton.GraphicsMaster;
import graphics.guiSkeleton.guiPanel.menuPanel.facilities.ButtonMaker;
import graphics.guiSkeleton.guiPanel.menuPanel.facilities.MenuPanel;
import graphics.ingame_input_listener.Input;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by dupriez on 01/01/16.
*/
public interface GameOverPanelAbstraction extends MenuPanelAbstraction {
/*What to do when it have been pressed*/
public void returnButtonAction();
}
package graphics.graphical_abstraction.panel.menu;
/**
* Created by dupriez on 14/11/15.
*/
public class GameOverPanelAbstractionController extends MenuPanelAbstractionController {
private GameOverPanelAbstraction gameOverPanel;
public GameOverPanelAbstractionController(GameOverPanelAbstraction gameOverPanel){
this.menuPanel = gameOverPanel;
this.gameOverPanel = gameOverPanel;
}
public void returnButtonPressed(){
this.gameOverPanel.returnButtonAction();
}
}
package graphics.guiSkeleton.guiPanel.menuPanel; package graphics.guiSkeleton.guiPanel.menuPanel;
import graphics.graphical_abstraction.GraphicsMasterAbstraction; import graphics.graphical_abstraction.GraphicsMasterAbstraction;
import graphics.graphical_abstraction.panel.menu.GameOverPanelAbstraction;
import graphics.graphical_abstraction.panel.menu.GameOverPanelAbstractionController;
import graphics.graphical_abstraction.panel.menu.MainMenuPanelAbstraction;
import graphics.guiSkeleton.GUIColorsAndFonts; import graphics.guiSkeleton.GUIColorsAndFonts;
import graphics.guiSkeleton.GraphicsMaster; import graphics.guiSkeleton.GraphicsMaster;
import graphics.guiSkeleton.guiPanel.menuPanel.facilities.ButtonMaker; import graphics.guiSkeleton.guiPanel.menuPanel.facilities.ButtonMaker;
...@@ -14,7 +17,9 @@ import java.awt.event.ActionListener; ...@@ -14,7 +17,9 @@ import java.awt.event.ActionListener;
/** /**
* Created by dupriez on 01/01/16. * Created by dupriez on 01/01/16.
*/ */
public class GameOverPanel extends MenuPanel { public class GameOverPanel extends MenuPanel implements GameOverPanelAbstraction {
GameOverPanelAbstractionController controller = new GameOverPanelAbstractionController(this);
public GameOverPanel(GraphicsMaster graphicsMaster) { public GameOverPanel(GraphicsMaster graphicsMaster) {
super(graphicsMaster); super(graphicsMaster);
...@@ -31,7 +36,7 @@ public class GameOverPanel extends MenuPanel { ...@@ -31,7 +36,7 @@ public class GameOverPanel extends MenuPanel {
private ActionListener returnButtonActionListener = new ActionListener() { private ActionListener returnButtonActionListener = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent actionEvent) { public void actionPerformed(ActionEvent actionEvent) {
getGraphicsMaster().changeGUIStateTo(GraphicsMaster.GUIStates.MAIN_MENU); controller.returnButtonPressed();
} }
}; };
...@@ -59,4 +64,9 @@ public class GameOverPanel extends MenuPanel { ...@@ -59,4 +64,9 @@ public class GameOverPanel extends MenuPanel {
public void keyTypedHandler(Input e) { public void keyTypedHandler(Input e) {
} }
@Override
public void returnButtonAction() {
getGraphicsMaster().changeGUIStateTo(GraphicsMaster.GUIStates.MAIN_MENU);
}
} }
...@@ -24,27 +24,23 @@ public class MainMenuPanel extends MenuPanel implements MainMenuPanelAbstraction ...@@ -24,27 +24,23 @@ public class MainMenuPanel extends MenuPanel implements MainMenuPanelAbstraction
setTitlePanel("The Dungeon Project"); setTitlePanel("The Dungeon Project");
addToCentralColumn(ButtonMaker.makeButton("single player", singlePlayerButtonListener),1,1); addToCentralColumn(ButtonMaker.makeButton("single player", singlePlayerButtonListener),1,1);
addToCentralColumn(ButtonMaker.makeButton("multi player", multiPlayerButtonListener),1,1); //addToCentralColumn(ButtonMaker.makeButtonWithImage("src/graphics/guiSkeleton/guiPanel/interfaceElements/singlePlayerButton.png", "src/graphics/guiSkeleton/guiPanel/interfaceElements/singlePlayerPressedButton.png",singlePlayerButtonListener),1,1);
addToCentralColumn(ButtonMaker.makeButton("multi player", multiPlayerButtonListener), 1, 1);
addToCentralColumn(ButtonMaker.makeButton("configuration", configurationButtonListener),1,1); addToCentralColumn(ButtonMaker.makeButton("configuration", configurationButtonListener),1,1);
addToCentralColumn(ButtonMaker.makeButton("IGP", IGPButtonListener),1,1); addToCentralColumn(ButtonMaker.makeButton("IGP", IGPButtonListener),1,1);
addToCentralColumn(ButtonMaker.makeButton("exit", exitButtonListener),1,1); addToCentralColumn(ButtonMaker.makeButton("exit", exitButtonListener),1,1);
// setBottomPanel("V1.0 - ENS team");
} }
private ActionListener singlePlayerButtonListener = new ActionListener() { private ActionListener singlePlayerButtonListener = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent actionEvent) { public void actionPerformed(ActionEvent actionEvent) {
controller.singlePlayerButtonPressed(); controller.singlePlayerButtonPressed();
//DummyLocalCore.getInstance().startGameSinglePlayer();
} }
}; };
private ActionListener multiPlayerButtonListener = new ActionListener() { private ActionListener multiPlayerButtonListener = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent actionEvent) { public void actionPerformed(ActionEvent actionEvent) {
//DummyLocalCore.getInstance().startGameMultiplayerPlayer();
controller.multiPlayerButtonPressed(); controller.multiPlayerButtonPressed();
} }
}; };
...@@ -89,7 +85,6 @@ public class MainMenuPanel extends MenuPanel implements MainMenuPanelAbstraction ...@@ -89,7 +85,6 @@ public class MainMenuPanel extends MenuPanel implements MainMenuPanelAbstraction
@Override @Override
public void initialise() { public void initialise() {
// underlyingMainMenuPanel.setPreferredSize(new Dimension(getSize().width, getSize().height)); // underlyingMainMenuPanel.setPreferredSize(new Dimension(getSize().width, getSize().height));
// System.out.println("Dimensions= "+getSize().width+", "+getSize().height); // System.out.println("Dimensions= "+getSize().width+", "+getSize().height);
// setSize(new Dimension(getSize().width, getSize().height)); // setSize(new Dimension(getSize().width, getSize().height));
......
...@@ -2,7 +2,8 @@ package graphics.guiSkeleton.guiPanel.menuPanel.configuration; ...@@ -2,7 +2,8 @@ package graphics.guiSkeleton.guiPanel.menuPanel.configuration;
import graphics.ingame_input_listener.InputConfiguration; import graphics.ingame_input_listener.InputConfiguration;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
...@@ -10,7 +11,7 @@ import java.util.ArrayList; ...@@ -10,7 +11,7 @@ import java.util.ArrayList;
*/ */
public class InputChangeFrame extends Frame implements ActionListener{ public class InputChangeFrame extends Frame implements ActionListener{
private ArrayList<Button> b= new ArrayList<Button>(); private ArrayList<Button> b= new ArrayList<>();
public static void main(String string) { public static void main(String string) {
InputChangeFrame myWindow = new InputChangeFrame(string); InputChangeFrame myWindow = new InputChangeFrame(string);
...@@ -20,13 +21,93 @@ public class InputChangeFrame extends Frame implements ActionListener{ ...@@ -20,13 +21,93 @@ public class InputChangeFrame extends Frame implements ActionListener{
public InputChangeFrame(String title) { public InputChangeFrame(String title) {
super(title); super(title);
setLayout(new GridLayout(13, 2)); String simpleKeyboard="abcdefghijklmnopqrstuvwxyz0123456789+-*(_)=,;:!^$/";
String alphabet="abcdefghijklmnopqrstuvwxyz"; Button button;
for (int i=0;i<alphabet.length();i++) {
b.add(new Button(Character.toString(alphabet.charAt(i)))); int LayoutHeight=simpleKeyboard.length()/2;
int LayoutWidth=3;
setLayout(new GridLayout(LayoutHeight,LayoutWidth));
//Adding monoalphabetic keyBoard input
for (int i=0;i<simpleKeyboard.length();i++) {
b.add(new Button(Character.toString(simpleKeyboard.charAt(i))));
b.get(i).addActionListener(this); b.get(i).addActionListener(this);
add(b.get(i)); add(b.get(i));
} }
//Adding arrow inputs
button=new Button("Right arrow");
button.addActionListener(this);
add(button);
button=new Button("Left arrow");
button.addActionListener(this);
add(button);
button=new Button("Up arrow");
button.addActionListener(this);
add(button);
button=new Button("Down arrow");
button.addActionListener(this);
add(button);
//Adding Fi inputs
button=new Button("F1");
button.addActionListener(this);
add(button);
button=new Button("F2");
button.addActionListener(this);
add(button);
button=new Button("F3");
button.addActionListener(this);
add(button);
button=new Button("F4");
button.addActionListener(this);
add(button);
button=new Button("F5");
button.addActionListener(this);
add(button);
button=new Button("F6");
button.addActionListener(this);
add(button);
button=new Button("F7");
button.addActionListener(this);
add(button);
button=new Button("F8");
button.addActionListener(this);
add(button);
button=new Button("F9");
button.addActionListener(this);
add(button);
button=new Button("F10");
button.addActionListener(this);
add(button);
button=new Button("F11");
button.addActionListener(this);
add(button);
button=new Button("F12");
button.addActionListener(this);
add(button);
//Adding other inputs
button=new Button("Escape");
button.addActionListener(this);
add(button);
button=new Button("Ctrl");
button.addActionListener(this);
add(button);
button=new Button("Caps lock");
button.addActionListener(this);
add(button);
button=new Button("Shift");
button.addActionListener(this);
add(button);
button=new Button("Back space");
button.addActionListener(this);
add(button);
button=new Button("Alt");
button.addActionListener(this);
add(button);
button=new Button("Tab");
button.addActionListener(this);
add(button);
button=new Button("Enter");
button.addActionListener(this);
add(button);
} }
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
......
...@@ -25,4 +25,16 @@ public class ButtonMaker { ...@@ -25,4 +25,16 @@ public class ButtonMaker {
return button; return button;
} }
public static JButton makeButtonWithImage(String unPressed,String Pressed, ActionListener buttonAction){
JButton button = new JButton(new ImageIcon(unPressed));
button.setPressedIcon(new ImageIcon(Pressed));
//button.setBorder(new EmptyBorder(1,0,0,0));
button.setOpaque(true);
button.setVisible(true);
button.setFocusable(true);
//button.setFocusPainted(false);
button.addActionListener(buttonAction);
return button;
}
} }
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