Commit ac01e7e0 authored by Huot Mathieu's avatar Huot Mathieu

improved the README

parent e2ecb53b
################### 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)
......@@ -8,3 +10,58 @@ To install it on debian stable or ubuntu 14.04 see in the wiki (TODO)
# To run
* Make sure to have java 1.8 : java -version
* make buildplay
################### 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 ###################
TODO
################### DEVELOPMENT ###################
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
-Bogdan Ursu
-Cohen Louis
-Chouasne-Guillon Gwendoline
-Delcros Lucas
-Dupriez Thomas
-Garnier Remy
-Ghyselen Alexis
-Guerquin Arnaud
-Hilaire Mathieu
-Hocquet Guillaume
-Huot Mathieu
-Lopez Théodore
-Ramusat Yann
-Ringeade Clément
-Toussaint Etienne
-Thomas Colin
-Ursu Bogdan
TODO : missing names to fill because not registered
......@@ -2,12 +2,14 @@ package graphics.guiSkeleton.GUIPanel;
import graphics.guiSkeleton.GUIColorsAndFonts;
import graphics.guiSkeleton.GraphicsMaster;
import graphics.guiSkeleton.RepaintTimer;
import graphics.ingame_input_listener.Input;
import graphics.ingame_input_listener.InputConfiguration;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
/**
......@@ -43,11 +45,11 @@ public class ConfigurationPanel extends MenuPanel {
setTitlePanel("Configuration");
ArrayList<buttonPanelButtonDefinition> buttonDefList = new ArrayList<>();
buttonDefList.add(new buttonPanelButtonDefinition("move up",configUpListener));
buttonDefList.add(new buttonPanelButtonDefinition("move down",configDownListener));
buttonDefList.add(new buttonPanelButtonDefinition("move right",configLeftListener));
buttonDefList.add(new buttonPanelButtonDefinition("move left",configRightListener));
buttonDefList.add(new buttonPanelButtonDefinition("back",backButtonListener));
buttonDefList.add(new buttonPanelButtonDefinition("move up: "+(InputConfiguration.GetKey(Input.UP_ARROW)),configUpListener));
buttonDefList.add(new buttonPanelButtonDefinition("move down: ",configDownListener));
buttonDefList.add(new buttonPanelButtonDefinition("move right: ",configLeftListener));
buttonDefList.add(new buttonPanelButtonDefinition("move left: ",configRightListener));
buttonDefList.add(new buttonPanelButtonDefinition("back: ",backButtonListener));
//TODO: not working for now
/*// Creation of the list of the keys linked with the buttons previously created
ArrayList<JPanel> keyList = new ArrayList<JPanel>();
......@@ -63,7 +65,7 @@ public class ConfigurationPanel extends MenuPanel {
private ActionListener configUpListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
moveUp=true;
moveUp=true;System.out.println(moveUp);
}
};
......@@ -101,7 +103,8 @@ public class ConfigurationPanel extends MenuPanel {
@Override
public void keyPressedHandler(Input e) {
//TODO: find a way to do this : change Input e into KeyEvent e
/*if (escape) {escape=false; InputConfiguration.ChangeInput(e,Input.ESCAPE);}
/*if(moveUp==true){moveUp=false;System.out.println(moveUp);InputConfiguration.ChangeKey(Input.UP_ARROW,KeyEvent.VK_B);System.out.println(InputConfiguration.up);}
if (escape) {escape=false; InputConfiguration.ChangeInput(e,Input.ESCAPE);}
if (moveUp){moveUp=false; InputConfiguration.ChangeInput(e,Input.UP_ARROW);}
if (moveDown){moveDown=false; InputConfiguration.ChangeInput(e,Input.DOWN_ARROW);}
if (moveLeft) {moveLeft=false; InputConfiguration.ChangeInput(e,Input.LEFT_ARROW);}
......@@ -109,9 +112,13 @@ public class ConfigurationPanel extends MenuPanel {
*/
}
@Override
public void keyReleasedHandler(Input e) {}
public void keyReleasedHandler(Input e) {
// if(moveUp==true){moveUp=false; InputConfiguration.ChangeKey(Input.UP_ARROW,KeyEvent.VK_B);System.out.println(InputConfiguration.up);}
}
@Override
public void keyTypedHandler(Input e) {}
public void keyTypedHandler(Input e) {
//if(moveUp==true){moveUp=false; InputConfiguration.ChangeKey(Input.UP_ARROW,KeyEvent.VK_B);System.out.println(InputConfiguration.up);}
}
@Override
public void initialise() {}
@Override
......
......@@ -240,10 +240,10 @@ public class GamePanel extends GUIPanel implements GameContentMapChangeListener
if (e == Input.DOWN_ARROW) {
MyInputInterpreter.setMoveYBottom(true);
}
if (e == Input.SPACE) {
if (e == Input.SPELL) {
MyInputInterpreter.setSpellCast(1);
}
if (e == Input.SQUARE) {
if (e == Input.ATTACK) {
followedRelayer.firstAction();
}
}
......
......@@ -9,6 +9,6 @@ package graphics.ingame_input_listener;
* if "a" is supposed to give a move left, then this
* is linked to LEFT_ARROW */
public enum Input {
SQUARE, TRIANGLE, CIRCLE, LEFT_ARROW ,RIGHT_ARROW ,UP_ARROW , DOWN_ARROW, ESCAPE, SPACE, NONE
ATTACK, SPELL, CIRCLE, LEFT_ARROW ,RIGHT_ARROW ,UP_ARROW , DOWN_ARROW, ESCAPE, SPACE, NONE
}
......@@ -11,26 +11,50 @@ public class InputConfiguration {
* converted to a formal one from the Input enum */
// initial keys that may be changed in the game
private static int square = KeyEvent.VK_K;
private static int attack = KeyEvent.VK_A;
private static int spell = KeyEvent.VK_S;
private static int circle = KeyEvent.VK_L;
private static int triangle = KeyEvent.VK_M;
private static int escape = KeyEvent.VK_ESCAPE;
private static int space = KeyEvent.VK_SPACE;
private static int up = KeyEvent.VK_UP;
public static int up = KeyEvent.VK_UP;
private static int down = KeyEvent.VK_DOWN;
private static int right = KeyEvent.VK_RIGHT;
private static int left = KeyEvent.VK_LEFT;
public static void ChangeKey(Input input, int j) {
switch(input){
case ATTACK:
attack=j;
case SPELL:
spell =j;
case CIRCLE:
circle=j;
case ESCAPE:
escape=j;
case UP_ARROW:
up=j;
case DOWN_ARROW:
down=j;
case RIGHT_ARROW:
right=j;
case LEFT_ARROW:
left=j;
default:
throw new IllegalStateException("Unknown input"+ input);
}
}
/**
* @param e : a key pressed
* @return the formal name linked with this input
*/
public static Input GetInput(KeyEvent e){
int event=e.getKeyCode();
if (event==square){return Input.SQUARE;}
if (event==attack){return Input.ATTACK;}
if (event==circle){return Input.CIRCLE;}
if (event==triangle){return Input.TRIANGLE;}
if (event== spell){return Input.SPELL;}
if (event==escape){return Input.ESCAPE;}
if (event==up){return Input.UP_ARROW;}
if (event==down){return Input.DOWN_ARROW;}
......@@ -46,61 +70,71 @@ public class InputConfiguration {
* and a blank if j is not the code of a usual keyboard character
*/
private static String GetChar(int j){
switch (j){
case KeyEvent.VK_A:
return "a";
case KeyEvent.VK_B:
return "b";
case KeyEvent.VK_C:
return "c";
case KeyEvent.VK_D:
return "d";
case KeyEvent.VK_E:
return "e";
case KeyEvent.VK_F:
return "f";
case KeyEvent.VK_G:
return "g";
case KeyEvent.VK_H:
return "h";
case KeyEvent.VK_I:
return "i";
case KeyEvent.VK_J:
return "j";
case KeyEvent.VK_K:
return "k";
case KeyEvent.VK_L:
return "l";
case KeyEvent.VK_M:
return "m";
case KeyEvent.VK_N:
return "n";
case KeyEvent.VK_O:
return "o";
case KeyEvent.VK_P:
return "p";
case KeyEvent.VK_Q:
return "q";
case KeyEvent.VK_R:
return "r";
case KeyEvent.VK_S:
return "s";
case KeyEvent.VK_T:
return "t";
case KeyEvent.VK_U:
return "u";
case KeyEvent.VK_V:
return "v";
case KeyEvent.VK_W:
return "w";
case KeyEvent.VK_X:
return "x";
case KeyEvent.VK_Y:
return "y";
case KeyEvent.VK_Z:
return "z";
switch (j) {
case KeyEvent.VK_A:
return "a";
case KeyEvent.VK_B:
return "b";
case KeyEvent.VK_C:
return "c";
case KeyEvent.VK_D:
return "d";
case KeyEvent.VK_E:
return "e";
case KeyEvent.VK_F:
return "f";
case KeyEvent.VK_G:
return "g";
case KeyEvent.VK_H:
return "h";
case KeyEvent.VK_I:
return "i";
case KeyEvent.VK_J:
return "j";
case KeyEvent.VK_K:
return "k";
case KeyEvent.VK_L:
return "l";
case KeyEvent.VK_M:
return "m";
case KeyEvent.VK_N:
return "n";
case KeyEvent.VK_O:
return "o";
case KeyEvent.VK_P:
return "p";
case KeyEvent.VK_Q:
return "q";
case KeyEvent.VK_R:
return "r";
case KeyEvent.VK_S:
return "s";
case KeyEvent.VK_T:
return "t";
case KeyEvent.VK_U:
return "u";
case KeyEvent.VK_V:
return "v";
case KeyEvent.VK_W:
return "w";
case KeyEvent.VK_X:
return "x";
case KeyEvent.VK_Y:
return "y";
case KeyEvent.VK_Z:
return "z";
case KeyEvent.VK_UP:
return "up_arrow";
case KeyEvent.VK_DOWN:
return "down_arrow";
case KeyEvent.VK_LEFT:
return "left_arrow";
case KeyEvent.VK_RIGHT:
return "right_arrow";
default:
throw new IllegalStateException("Unknown int" + j);
}
return " ";
}
/**
......@@ -109,10 +143,10 @@ public class InputConfiguration {
*/
public static String GetKey(Input input){
switch (input) {
case SQUARE:
return GetChar(square);
case TRIANGLE:
return GetChar(triangle);
case ATTACK:
return GetChar(attack);
case SPELL:
return GetChar(spell);
case CIRCLE:
return GetChar(circle);
case ESCAPE:
......@@ -139,11 +173,11 @@ public class InputConfiguration {
*/
public static void ChangeInput(KeyEvent e, Input input){
switch (input){
case SQUARE:
square=e.getKeyCode();
case ATTACK:
attack=e.getKeyCode();
break;
case TRIANGLE:
triangle=e.getKeyCode();
case SPELL:
spell =e.getKeyCode();
break;
case CIRCLE:
circle=e.getKeyCode();
......
......@@ -124,7 +124,7 @@ public class TermFrameKeyListener extends Thread implements FrameKeyListenerAbst
}
if (line == 'e') { // \/, down arrow
//graphicsMaster.keyPressedHandler(Input.DOWN_ARROW);
inputs_current.add(Input.SQUARE);
inputs_current.add(Input.ATTACK);
}
try {
if(in.ready()){
......
package graphics.termSkeleton.termPanel;
import graphics.graphical_abstraction.GraphicsMasterAbstraction;
import graphics.guiSkeleton.GUIColorsAndFonts;
import graphics.guiSkeleton.GraphicsMaster;
import graphics.ingame_input_listener.Input;
import graphics.termSkeleton.GraphicsMasterTerm;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.util.ArrayList;
/**
......@@ -232,7 +227,7 @@ public abstract class MenuTermPanel extends TermPanel {
if(e == Input.DOWN_ARROW){
if(current_position < nb_panel) current_position++;
}
if(e == Input.SQUARE){
if(e == Input.ATTACK){
this.getGraphicsMaster().changeGUIStateTo(buttonDefList.get(this.current_position-1).getButtonGUIStates());
}
}
......
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