X-Git-Url: https://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fgame%2FGamePhysics.java;h=d78d319efaeff1875fa38c6b22c02829e36aeec1;hp=fe0765a0fa06b9f06a17344a3973ad82b2637e41;hb=5fd3c5a7647fbf36de84ff184f58fad5e0e30644;hpb=feb58daa2c3e8126871e9d4f26e978d2fc1fb01c diff --git a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java index fe0765a..d78d319 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java @@ -38,8 +38,8 @@ public class GamePhysics { default: bl = 0; } - return (bl > 0 && Items.blocks.getValueAt(bl).toJump() && - (rect.y + rect.height) - Items.blocks.getValueAt(bl).getRect((int) ((rect.x - 8) / 16), (int) ((rect.y + rect.height - 8) / 16)).y > 8); + return (bl > 0 && GameItems.getBlock(bl).toJump() && + (rect.y + rect.height) - GameItems.getBlock(bl).getRect((int) ((rect.x - 8) / 16), (int) ((rect.y + rect.height - 8) / 16)).y > 8); } private boolean checkColl(Rectangle rect) { @@ -53,8 +53,8 @@ public class GamePhysics { for (int y = minY; y < maxY; y++) { for (int x = minX; x < maxX; x++) { bl = gp.world.getForeMap(x, y); - if (bl > 0 && Items.blocks.getValueAt(bl).coll) { - if (Intersector.overlaps(rect, Items.blocks.getValueAt(bl).getRect(x, y))) { + if (bl > 0 && GameItems.getBlock(bl).coll) { + if (Intersector.overlaps(rect, GameItems.getBlock(bl).getRect(x, y))) { return true; } } @@ -93,7 +93,7 @@ public class GamePhysics { pl.canJump = false; } - if (Items.isFluid(getBlock(pl.getRect()))) { + if (GameItems.isFluid(getBlock(pl.getRect()))) { if (CaveGame.TOUCH && pl.move.x != 0 && !gp.swim && !pl.flyMode) gp.swim = true; if (!gp.swim) { if (!pl.flyMode && pl.move.y < 4.5f) pl.move.add(gravity.x / 4, gravity.y / 4); @@ -148,7 +148,7 @@ public class GamePhysics { mob.canJump = false; } - if (mob.getType() == 0 && Items.isFluid(getBlock(mob.getRect()))) { + if (mob.getType() == 0 && GameItems.isFluid(getBlock(mob.getRect()))) { if (mob.move.y > 9) mob.move.add(0, -.9f); mob.move.add(0, -.5f); if (mob.move.y < -3) mob.move.y = -3;