OSDN Git Service

[updated] metagun input. still not there. no time for now.
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sun, 6 Feb 2011 12:53:25 +0000 (12:53 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sun, 6 Feb 2011 12:53:25 +0000 (12:53 +0000)
demos/metagun/metagun-desktop/src/com/mojang/metagun/Input.java

index f9ac130..ddce477 100644 (file)
@@ -103,15 +103,21 @@ public class Input implements InputProcessor {
                return false;\r
        }\r
 \r
-       @Override public boolean touchDown (int x, int y, int pointer, int button) {\r
-               return false;\r
-       }\r
+       @Override public boolean touchDown (int x, int y, int pointer, int button) {            \r
+               return false;           \r
+       }       \r
 \r
        @Override public boolean touchUp (int x, int y, int pointer, int button) {\r
-               if(x > 160 - 32 && x < 160) \r
+               if(x > 160 - 32 && x < 160) {\r
                        set(Keys.KEYCODE_DPAD_UP, !buttons[UP]);\r
-               if(x > 160 && x < 160 + 32) \r
+                       if(buttons[UP])\r
+                               buttons[DOWN] = false;\r
+               }\r
+               if(x > 160 && x < 160 + 32) { \r
                        set(Keys.KEYCODE_DPAD_DOWN, !buttons[DOWN]);\r
+                       if(buttons[DOWN])\r
+                               buttons[UP] = false;\r
+               }\r
                return false;\r
        }\r
 \r