Commit 9149878c authored by Matthieu Moy's avatar Matthieu Moy

lab1 fixes

parent 97029047
Pipeline #5466 failed with stage
in 1 minute and 20 seconds
......@@ -63,11 +63,7 @@ public class Field extends Canvas {
*/
this.setOnKeyPressed(new EventHandler<KeyEvent>() {
public void handle(KeyEvent e) {
String code = e.getCode().toString();
// only add once... prevent duplicates
if (!input.contains(code)) {
input.add(code);
}
; // TODO
}
});
......@@ -77,8 +73,7 @@ public class Field extends Canvas {
*/
this.setOnKeyReleased(new EventHandler<KeyEvent>() {
public void handle(KeyEvent e) {
String code = e.getCode().toString();
input.remove(code);
; // TODO
}
});
......@@ -96,11 +91,7 @@ public class Field extends Canvas {
// Deplacement et affichage des poneys
for (int i = 0; i < poneys.length; i++) {
if (i == 0 && input.contains("RIGHT")) {
poneys[i].boost();
} else {
poneys[i].move();
}
poneys[i].move();
poneys[i].display();
}
}
......
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