X-Git-Url: https://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fgame%2FGameProc.java;h=08f44251f6ed20bdca7fa9d38cbcab54c799a647;hp=e091494daeec99d256544ad78bd7f22daffdf95a;hb=be2690f1dee10f68a5ce6d576ace13c825ac5d15;hpb=5fd3c5a7647fbf36de84ff184f58fad5e0e30644 diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameProc.java b/core/src/ru/deadsoftware/cavecraft/game/GameProc.java index e091494..08f4425 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameProc.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameProc.java @@ -34,7 +34,7 @@ public class GameProc implements Serializable { public transient GamePhysics physics; public int curX, curY; - public int invSlot; + public int slot; public int ctrlMode; public int creativeScroll, maxCreativeScroll; public int blockDmg = 0; @@ -84,10 +84,10 @@ public class GameProc implements Serializable { private void moveCursor() { int pastX = curX, pastY = curY; if (ctrlMode == 0 && CaveGame.TOUCH) { - curX = (int) (player.position.x + player.texWidth / 2) / 16; + curX = (int) (player.pos.x + player.texWidth / 2) / 16; if (player.dir == 0) curX--; else curX++; - curY = (int) (player.position.y + player.texWidth) / 16; + curY = (int) (player.pos.y + player.texWidth) / 16; if (!isAutoselectable(curX, curY)) { curY++; } @@ -114,9 +114,9 @@ public class GameProc implements Serializable { if (curY < 0) curY = 0; if (curY >= world.getHeight()) curY = world.getHeight() - 1; if (ctrlMode == 1) { - if (curX * 16 + 8 < player.position.x + player.texWidth / 2) + if (curX * 16 + 8 < player.pos.x + player.texWidth / 2) player.dir = 0; - if (curX * 16 + 8 > player.position.x + player.texWidth / 2) + if (curX * 16 + 8 > player.pos.x + player.texWidth / 2) player.dir = 1; } } @@ -423,7 +423,7 @@ public class GameProc implements Serializable { if (isTouchDown && TimeUtils.timeSinceMillis(touchDownTime) > 500) { if (touchDownBtn == Input.Buttons.RIGHT) { - useItem(curX, curY, player.inventory[invSlot], true); + useItem(curX, curY, player.inv[slot], true); isTouchDown = false; } else if (touchDownY < Assets.invBar.getRegionHeight() && touchDownX > renderer.getWidth() / 2 - Assets.invBar.getRegionWidth() / 2 &&