diff --git a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java
index 28a8333214fe4983c95f7e3f5ea868f536384910..fdf1206371935e23a848428fca23f3d594c61b33 100644 (file)
switch (dir) {
case 0:
bl = gameProc.world.getForeMap((int)((rect.x-8)/16),(int)((rect.y+rect.height-8)/16));
switch (dir) {
case 0:
bl = gameProc.world.getForeMap((int)((rect.x-8)/16),(int)((rect.y+rect.height-8)/16));
- if (checkColl(new Rectangle(rect.x+rect.width/2, rect.y-18, rect.width, rect.height))) bl=0;
+ if (checkColl(new Rectangle(rect.x-8, rect.y-18, rect.width, rect.height))) bl=0;
break;
case 1:
bl = gameProc.world.getForeMap((int)((rect.x+rect.width+8)/16),(int)((rect.y+rect.height-8)/16));
break;
case 1:
bl = gameProc.world.getForeMap((int)((rect.x+rect.width+8)/16),(int)((rect.y+rect.height-8)/16));
- if (checkColl(new Rectangle(rect.x+rect.width/2, rect.y-18, rect.width, rect.height))) bl=0;
+ if (checkColl(new Rectangle(rect.x+rect.width+8, rect.y-18, rect.width, rect.height))) bl=0;
break;
default:
bl=0;
break;
default:
bl=0;
if (Items.isFluid(getBlock(pl.getRect()))) {
if (CaveGame.TOUCH && pl.moveX.x!=0 && !gameProc.swim && !pl.flyMode) gameProc.swim = true;
if (!gameProc.swim) {
if (Items.isFluid(getBlock(pl.getRect()))) {
if (CaveGame.TOUCH && pl.moveX.x!=0 && !gameProc.swim && !pl.flyMode) gameProc.swim = true;
if (!gameProc.swim) {
- if (!pl.flyMode && pl.moveY.y < 9) pl.moveY.add(gravity.x / 2, gravity.y / 2);
- if (!pl.flyMode && pl.moveY.y > 9) pl.moveY.add(0, -.9f);
+ if (!pl.flyMode && pl.moveY.y < 4.5f) pl.moveY.add(gravity.x / 4, gravity.y / 4);
+ if (!pl.flyMode && pl.moveY.y > 4.5f) pl.moveY.add(0, -1f);
} else {
pl.moveY.add(0, -.5f);
if (pl.moveY.y<-3) pl.moveY.y = -3;
}
} else {
if (!pl.flyMode && pl.moveY.y<18) pl.moveY.add(gravity);
} else {
pl.moveY.add(0, -.5f);
if (pl.moveY.y<-3) pl.moveY.y = -3;
}
} else {
if (!pl.flyMode && pl.moveY.y<18) pl.moveY.add(gravity);
- if (CaveGame.TOUCH && gameProc.swim) gameProc.swim = false;
}
pl.position.add(pl.moveX);
}
pl.position.add(pl.moveX);