diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameInput.java b/core/src/ru/deadsoftware/cavedroid/game/GameInput.java
index ca603176453f1ac7e219c6d825c11dfeb1f8f528..3f9b77322431e0275640edd3f12f6bf7d9b71626 100644 (file)
if (checkSwim()) {
mPlayer.swim = true;
} else if (mPlayer.canJump()) {
- mPlayer.getMove().add(0, -7);
+ mPlayer.getVelocity().add(0, -7);
} else if (!mPlayer.isFlyMode() && mPlayer.gameMode == 1) {
mPlayer.setFlyMode(true);
- mPlayer.getMove().y = 0;
+ mPlayer.getVelocity().y = 0;
} else if (mPlayer.isFlyMode()) {
- mPlayer.getMove().y = -GamePhysics.PL_SPEED;
+ mPlayer.getVelocity().y = -GamePhysics.PL_SPEED;
}
}
if (mControlMode == ControlMode.WALK || !mMainConfig.isTouch()) {
switch (keycode) {
case Input.Keys.A:
- mPlayer.getMove().x = -GamePhysics.PL_SPEED;
+ mPlayer.getVelocity().x = -GamePhysics.PL_SPEED;
mPlayer.setDir(Mob.Direction.LEFT);
if (mMainConfig.isTouch() && checkSwim()) {
mPlayer.swim = true;
}
break;
case Input.Keys.D:
- mPlayer.getMove().x = GamePhysics.PL_SPEED;
+ mPlayer.getVelocity().x = GamePhysics.PL_SPEED;
mPlayer.setDir(Mob.Direction.RIGHT);
if (mMainConfig.isTouch() && checkSwim()) {
mPlayer.swim = true;
break;
case Input.Keys.S:
case Input.Keys.CONTROL_LEFT:
- mPlayer.getMove().y = GamePhysics.PL_SPEED;
+ mPlayer.getVelocity().y = GamePhysics.PL_SPEED;
break;
}
} else {
switch (keycode) {
case Input.Keys.A:
case Input.Keys.D:
- mPlayer.getMove().x = 0;
+ mPlayer.getVelocity().x = 0;
if (mMainConfig.isTouch() && mPlayer.swim) {
mPlayer.swim = false;
}
case Input.Keys.SPACE:
case Input.Keys.CONTROL_LEFT:
if (mPlayer.isFlyMode()) {
- mPlayer.getMove().y = 0;
+ mPlayer.getVelocity().y = 0;
}
if (mPlayer.swim) {
mPlayer.swim = false;
}
}
- public void scrolled(int amount) {
+ public void scrolled(float amountX, float amountY) {
switch (mMainConfig.getGameUiWindow()) {
case NONE:
- mPlayer.slot += amount;
+ mPlayer.slot += (int) amountY;
if (mPlayer.slot < 0) {
mPlayer.slot = 8;
}
}
break;
case CREATIVE_INVENTORY:
- mCreativeScroll += amount;
+ mCreativeScroll += (int) amountY;
if (mCreativeScroll < 0) {
mCreativeScroll = 0;
}