From 26a486a8f4d72481304a102ae2560317a35f87ac Mon Sep 17 00:00:00 2001 From: GammelJan Date: Thu, 2 Apr 2020 13:02:29 +0200 Subject: [PATCH] player flips, stays flipped when moving left - bug fixed --- .../com/dungeoncrawler/control/Controller.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/src/com/dungeoncrawler/control/Controller.java b/core/src/com/dungeoncrawler/control/Controller.java index 8c9180b..8019303 100644 --- a/core/src/com/dungeoncrawler/control/Controller.java +++ b/core/src/com/dungeoncrawler/control/Controller.java @@ -67,17 +67,25 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ @Override public boolean keyUp(int keycode) { - if(keycode == Input.Keys.LEFT || keycode == Input.Keys.RIGHT){ + if(keycode == Input.Keys.LEFT){ movementX = 0f; - v.trechtsstop(); v.tlinksstop(); } - if(keycode == Input.Keys.DOWN || keycode == Input.Keys.UP){ + if(keycode == Input.Keys.RIGHT){ + movementX = 0f; + v.trechtsstop(); + } + + if(keycode == Input.Keys.DOWN){ movementY = 0f; - v.tobenstop(); v.tuntenstop(); } + + if(keycode == Input.Keys.UP){ + movementY = 0f; + v.tobenstop(); + } return true; }