diff --git a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java
index 2fdc29bca17b88dd066b8ef1ebd8840fc0cab6cb..3c2e9ec718f1653526f93b70edf30dda8928054b 100644 (file)
while (checkColl(pl.getRect())) pl.position.x += d;
}
}
+ if (pl.position.x+pl.texWidth/2<0) pl.position.x+=gameProc.world.getWidth()*16;
+ if (pl.position.x+pl.texWidth/2>gameProc.world.getWidth()*16) pl.position.x-=gameProc.world.getWidth()*16;
if (pl.position.y > gameProc.world.getHeight()*16) {
- pl.position = gameProc.world.getSpawnPoint().cpy();
+ pl.position = gameProc.world.getSpawnPoint(0).cpy();
}
if (CaveGame.TOUCH && checkJump(pl.getRect(), pl.dir) && !pl.flyMode && pl.canJump && !pl.moveX.equals(Vector2.Zero)) {
pl.moveY.add(0, -8);
}
mob.moveY.add(gravity);
mob.position.add(mob.moveX);
+ if (mob.position.x+mob.width/2<0) mob.position.x+=gameProc.world.getWidth()*16;
+ if (mob.position.x+mob.width/2>gameProc.world.getWidth()*16) mob.position.x-=gameProc.world.getWidth()*16;
if (checkColl(mob.getRect())) {
int d = 0;
if (mob.moveX.x<0) d=1; else if (mob.moveX.x>0) d=-1;