diff --git a/core/src/ru/deadsoftware/cavedroid/game/GamePhysics.java b/core/src/ru/deadsoftware/cavedroid/game/GamePhysics.java
index cd900d873dc1398e6b41ea492be77a87feaca25a..70afcbfe5d3f1be77cdd772d61584b142022f7bd 100644 (file)
@GameScope
public class GamePhysics {
- public static final float PL_SPEED = 69.072f;
public static final float PL_JUMP_VELOCITY = -133.332f;
public static final float PL_TERMINAL_VELOCITY = 1254.4f;
}
} else {
player.getVelocity().y += PL_JUMP_VELOCITY * delta;
- if (player.getVelocity().y < -PL_SPEED) {
- player.getVelocity().y = -PL_SPEED;
+ if (player.getVelocity().y < -player.getSpeed()) {
+ player.getVelocity().y = -player.getSpeed();
}
}
} else {
mobXColl(player);
if (mMainConfig.isTouch() && !player.isFlyMode() && player.canJump() && player.getVelocity().x != 0 && checkJump(player)) {
- player.getVelocity().y = PL_JUMP_VELOCITY;
+ player.jump();
player.setCanJump(false);
}
}
mob.getVelocity().y += PL_JUMP_VELOCITY * delta;
- if (mob.getVelocity().y < -PL_SPEED) {
- mob.getVelocity().y = -PL_SPEED;
+ if (mob.getVelocity().y < -mob.getSpeed()) {
+ mob.getVelocity().y = -mob.getSpeed();
}
} else if (!mob.isFlyMode() && mob.getVelocity().y < PL_TERMINAL_VELOCITY) {
mob.getVelocity().y += gravity.y * delta;
mobXColl(mob);
if (mob.canJump() && mob.getVelocity().x != 0 && checkJump(mob)) {
- mob.getVelocity().y = PL_JUMP_VELOCITY;
+ mob.jump();
mob.setCanJump(false);
}
}