diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java b/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java
index ff8fa2e89438cec46984e53333740fcc9e72521b..d63568cb1dad36a1cfd5bd16d310e6fe43297657 100644 (file)
public void touchUp(int screenX, int screenY, int button) {
if (gameProc.isTouchDown) {
if (button == Input.Buttons.RIGHT){
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);
} else if (button == Input.Buttons.LEFT) {
if (gameProc.world.getForeMap(gameProc.cursorX, gameProc.cursorY) > 0) {
gameProc.world.placeToForeground(gameProc.cursorX, gameProc.cursorY, 0);
gameProc.isTouchDown = false;*/
}
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;
+ }
+
}
}