X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavedroid%2Fgame%2FGameInput.java;h=2bf6e7d096ab17912d6794841661a212841c1988;hb=462f97f8da742fe35f516fec00ca9a581d688e7a;hp=29c8188d9d6c44f07946a8f464913a01fab1e0ea;hpb=9f47e596782628c69b1333e371ce6ffc5cf3d5fa;p=cavedroid.git diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameInput.java b/core/src/ru/deadsoftware/cavedroid/game/GameInput.java index 29c8188..2bf6e7d 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/GameInput.java +++ b/core/src/ru/deadsoftware/cavedroid/game/GameInput.java @@ -69,12 +69,12 @@ public class GameInput { if (checkSwim()) { mPlayer.swim = true; } else if (mPlayer.canJump()) { - mPlayer.getVelocity().add(0, GamePhysics.PL_JUMP_VELOCITY); + mPlayer.jump(); } else if (!mPlayer.isFlyMode() && mPlayer.gameMode == 1) { mPlayer.setFlyMode(true); mPlayer.getVelocity().y = 0; } else if (mPlayer.isFlyMode()) { - mPlayer.getVelocity().y = -GamePhysics.PL_SPEED; + mPlayer.getVelocity().y = -mPlayer.getSpeed(); } } @@ -91,14 +91,14 @@ public class GameInput { if (mControlMode == ControlMode.WALK || !mMainConfig.isTouch()) { switch (keycode) { case Input.Keys.A: - mPlayer.getVelocity().x = -GamePhysics.PL_SPEED; + mPlayer.getVelocity().x = -mPlayer.getSpeed(); mPlayer.setDir(Mob.Direction.LEFT); if (mMainConfig.isTouch() && checkSwim()) { mPlayer.swim = true; } break; case Input.Keys.D: - mPlayer.getVelocity().x = GamePhysics.PL_SPEED; + mPlayer.getVelocity().x = mPlayer.getSpeed(); mPlayer.setDir(Mob.Direction.RIGHT); if (mMainConfig.isTouch() && checkSwim()) { mPlayer.swim = true; @@ -110,7 +110,7 @@ public class GameInput { break; case Input.Keys.S: case Input.Keys.CONTROL_LEFT: - mPlayer.getVelocity().y = GamePhysics.PL_SPEED; + mPlayer.getVelocity().y = mPlayer.getSpeed(); break; } } else {