Skip to content
Snippets Groups Projects
Commit 12e6b9fa authored by MEDEDJI Setondji's avatar MEDEDJI Setondji :speech_balloon:
Browse files

correction du bug (inversion des touches des raquettes)

parent 10cb2254
Branches br1
No related tags found
No related merge requests found
Pipeline #25212 passed
...@@ -107,28 +107,28 @@ public class Kernel { ...@@ -107,28 +107,28 @@ public class Kernel {
Action upAction = new AbstractAction() { Action upAction = new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
physicEngine.pongObjectEntityHashMap.get(gameObjects.get(0)).setSpeed(new Coordinates2D(0, -3)); physicEngine.pongObjectEntityHashMap.get(gameObjects.get(1)).setSpeed(new Coordinates2D(0, -3));
} }
}; };
Action downAction = new AbstractAction() { Action downAction = new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
physicEngine.pongObjectEntityHashMap.get(gameObjects.get(0)).setSpeed(new Coordinates2D(0, 3)); physicEngine.pongObjectEntityHashMap.get(gameObjects.get(1)).setSpeed(new Coordinates2D(0, 3));
} }
}; };
Action zAction = new AbstractAction() { Action zAction = new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
physicEngine.pongObjectEntityHashMap.get(gameObjects.get(1)).setSpeed(new Coordinates2D(0, -3)); physicEngine.pongObjectEntityHashMap.get(gameObjects.get(0)).setSpeed(new Coordinates2D(0, -3));
} }
}; };
Action sAction = new AbstractAction() { Action sAction = new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
physicEngine.pongObjectEntityHashMap.get(gameObjects.get(1)).setSpeed(new Coordinates2D(0, 3)); physicEngine.pongObjectEntityHashMap.get(gameObjects.get(0)).setSpeed(new Coordinates2D(0, 3));
} }
}; };
...@@ -148,28 +148,28 @@ public class Kernel { ...@@ -148,28 +148,28 @@ public class Kernel {
Action upReleaseAction = new AbstractAction() { Action upReleaseAction = new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
physicEngine.pongObjectEntityHashMap.get(gameObjects.get(0)).setSpeed(new Coordinates2D(0, 0)); physicEngine.pongObjectEntityHashMap.get(gameObjects.get(1)).setSpeed(new Coordinates2D(0, 0));
} }
}; };
Action downReleaseAction = new AbstractAction() { Action downReleaseAction = new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
physicEngine.pongObjectEntityHashMap.get(gameObjects.get(0)).setSpeed(new Coordinates2D(0, 0)); physicEngine.pongObjectEntityHashMap.get(gameObjects.get(1)).setSpeed(new Coordinates2D(0, 0));
} }
}; };
Action zReleaseAction = new AbstractAction() { Action zReleaseAction = new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
physicEngine.pongObjectEntityHashMap.get(gameObjects.get(1)).setSpeed(new Coordinates2D(0, 0)); physicEngine.pongObjectEntityHashMap.get(gameObjects.get(0)).setSpeed(new Coordinates2D(0, 0));
} }
}; };
Action sReleaseAction = new AbstractAction() { Action sReleaseAction = new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
physicEngine.pongObjectEntityHashMap.get(gameObjects.get(1)).setSpeed(new Coordinates2D(0, 0)); physicEngine.pongObjectEntityHashMap.get(gameObjects.get(0)).setSpeed(new Coordinates2D(0, 0));
} }
}; };
...@@ -197,7 +197,5 @@ public class Kernel { ...@@ -197,7 +197,5 @@ public class Kernel {
graphicEngine.addButton(button); graphicEngine.addButton(button);
} }
public void addLabel(JLabel label){
graphicEngine.addLabel(label);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment