diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java b/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java
index 26b4b6acdc9bfba26fd494d123ef7929c0ffcab2..d63568cb1dad36a1cfd5bd16d310e6fe43297657 100644 (file)
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);
}
public void touchDragged(int screenX, int screenY) {
- gameProc.renderer.camera.position.x += (gameProc.touchDownX-screenX);
+ /*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;
+ 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;
}
}