X-Git-Url: http://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fgame%2FGamePhysics.java;h=b5c5eab20a717acb6a00c1b7e1263b6026961078;hp=dc0c93d65c6df3ec56f4a95296653a44c3af8d96;hb=d7f5950fc751cec8fa64005dd1886cac4081ee99;hpb=e31e819b4fc6afdc3612e0ada5066dab638e89ac diff --git a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java index dc0c93d..b5c5eab 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java @@ -71,6 +71,9 @@ public class GamePhysics { if (drop.closeToPlayer(gp) > 0) { drop.moveToPlayer(gp); } else { + if (drop.move.x >= .5f) drop.move.x -= .5f; + else if (drop.move.x <= -.5f) drop.move.x += .5f; + else drop.move.x = 0; if (drop.move.y < 9) drop.move.y += gravity.y / 4; } drop.pos.add(drop.move); @@ -128,7 +131,7 @@ public class GamePhysics { if (pl.pos.x + pl.texWidth / 2 > gp.world.getWidth() * 16) pl.pos.x -= gp.world.getWidth() * 16; if (pl.pos.y > gp.world.getHeight() * 16) { - pl.pos = gp.world.getSpawnPoint().cpy(); + pl.respawn(gp.world); } if (CaveGame.TOUCH && checkJump(pl.getRect(), pl.dir) && !pl.flyMode && pl.canJump && pl.move.x != 0) { pl.move.add(0, -8);