From: fred-boy Date: Sat, 7 Apr 2018 03:14:04 +0000 (+0700) Subject: Change desktop controls X-Git-Tag: alpha0.1~19 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=472a7548653e0660f3f9ff1d47b03f81ccc97ccd;p=cavedroid.git Change desktop controls --- diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java b/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java index d63568c..899fbba 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java @@ -12,20 +12,20 @@ public class GameInputHandler { } public void keyDown(int keyCode) { - if (keyCode == Input.Keys.LEFT) { + if (keyCode == Input.Keys.A) { gameProc.player.moveX.add(-GamePhysics.PL_SPEED,0); gameProc.player.dir = 0; } - if (keyCode == Input.Keys.RIGHT) { + if (keyCode == Input.Keys.D) { gameProc.player.moveX.add(GamePhysics.PL_SPEED,0); gameProc.player.dir = 1; } - if (keyCode == Input.Keys.UP && + if (keyCode == Input.Keys.SPACE && gameProc.player.canJump) gameProc.player.moveY.add(0,-8); } public void keyUp(int keyCode) { - if (keyCode == Input.Keys.RIGHT || keyCode == Input.Keys.LEFT) { + if (keyCode == Input.Keys.A || keyCode == Input.Keys.D) { gameProc.player.moveX.x = 0; } } @@ -68,11 +68,6 @@ public class GameInputHandler { } public void touchDragged(int screenX, int screenY) { - /*gameProc.renderer.camera.position.x += (gameProc.touchDownX-screenX); - gameProc.renderer.camera.position.y += (gameProc.touchDownY-screenY); - gameProc.touchDownX = screenX; - gameProc.touchDownY = screenY; - gameProc.isTouchDown = false;*/ } public void scrolled(int amount) {