X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fgame%2FGameInput.java;h=5f7dfea6e2714ee3306ef5666585b5e6b9997642;hb=18f9e2e6b8a17746e80f8332a7a57f6296678bdd;hp=608ed9f4e93e1f1e45775f88dab29ad1a83875c5;hpb=feb58daa2c3e8126871e9d4f26e978d2fc1fb01c;p=cavedroid.git diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameInput.java b/core/src/ru/deadsoftware/cavecraft/game/GameInput.java index 608ed9f..5f7dfea 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameInput.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameInput.java @@ -17,7 +17,7 @@ public class GameInput { } private boolean checkSwim() { - return (Items.isFluid(gp.world.getForeMap((int) (gp.player.position.x + gp.player.width / 2) / 16, + return (GameItems.isFluid(gp.world.getForeMap((int) (gp.player.position.x + gp.player.width / 2) / 16, (int) (gp.player.position.y + gp.player.height / 4 * 3) / 16))); } @@ -147,21 +147,21 @@ public class GameInput { int iy = (int) (screenY - (gp.renderer.getHeight() / 2 - Assets.creativeInv.getRegionHeight() / 2 + 18)) / 18; int item = gp.creativeScroll * 8 + (ix + iy * 8); if (ix >= 8 || ix < 0 || iy < 0 || iy >= 5) item = -1; - if (item >= 0 && item < Items.items.size()) { + if (item >= 0 && item < GameItems.getItemsSize()) { for (int i = 8; i > 0; i--) { - gp.player.inventory[i] = gp.player.inventory[i - 1]; + gp.player.inv[i] = gp.player.inv[i - 1]; } - gp.player.inventory[0] = item; + gp.player.inv[0] = item; } } else if (CaveGame.STATE == AppState.GAME_CREATIVE_INV) { CaveGame.STATE = AppState.GAME_PLAY; } else if (screenY < Assets.invBar.getRegionHeight() && screenX > gp.renderer.getWidth() / 2 - Assets.invBar.getRegionWidth() / 2 && screenX < gp.renderer.getWidth() / 2 + Assets.invBar.getRegionWidth() / 2) { - gp.invSlot = (int) ((screenX - (gp.renderer.getWidth() / 2 - Assets.invBar.getRegionWidth() / 2)) / 20); + gp.slot = (int) ((screenX - (gp.renderer.getWidth() / 2 - Assets.invBar.getRegionWidth() / 2)) / 20); } else if (button == Input.Buttons.RIGHT) { gp.useItem(gp.curX, gp.curY, - gp.player.inventory[gp.invSlot], false); + gp.player.inv[gp.slot], false); } else if (button == Input.Buttons.LEFT) { gp.blockDmg = 0; } @@ -188,9 +188,9 @@ public class GameInput { public void scrolled(int amount) { switch (CaveGame.STATE) { case GAME_PLAY: - gp.invSlot += amount; - if (gp.invSlot < 0) gp.invSlot = 8; - if (gp.invSlot > 8) gp.invSlot = 0; + gp.slot += amount; + if (gp.slot < 0) gp.slot = 8; + if (gp.slot > 8) gp.slot = 0; break; case GAME_CREATIVE_INV: gp.creativeScroll += amount;