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;
}
}