X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fgame%2FGameInputHandler.java;h=d63568cb1dad36a1cfd5bd16d310e6fe43297657;hb=7115b8cce5cc8469c03ea1fa1fc24506a1e2765e;hp=ff8fa2e89438cec46984e53333740fcc9e72521b;hpb=64a6c34329b06cedce95dbe32bf6deac97971249;p=cavedroid.git diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java b/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java index ff8fa2e..d63568c 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java @@ -54,7 +54,8 @@ public class GameInputHandler { public void touchUp(int screenX, int screenY, int button) { if (gameProc.isTouchDown) { if (button == Input.Buttons.RIGHT){ - gameProc.world.placeToForeground(gameProc.cursorX, gameProc.cursorY, 1); + gameProc.world.placeToForeground(gameProc.cursorX, gameProc.cursorY, + gameProc.player.inventory[gameProc.invSlot]); } else if (button == Input.Buttons.LEFT) { if (gameProc.world.getForeMap(gameProc.cursorX, gameProc.cursorY) > 0) { gameProc.world.placeToForeground(gameProc.cursorX, gameProc.cursorY, 0); @@ -74,4 +75,10 @@ public class GameInputHandler { gameProc.isTouchDown = false;*/ } + public void scrolled(int amount) { + gameProc.invSlot += amount; + if (gameProc.invSlot < 0) gameProc.invSlot = 8; + if (gameProc.invSlot > 8) gameProc.invSlot = 0; + } + }