From: LMH Date: Tue, 18 Jun 2013 02:55:11 +0000 (-1000) Subject: Stopped Tux from finishing execution of a backflip if interrupted by climbing, double... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b5a5245f8f2f4c093d3d6a4cd35f65773c10f95d;p=supertux.git Stopped Tux from finishing execution of a backflip if interrupted by climbing, doubled horizontal climbing speed, reduced horizontal climbing alignment acceleration --- diff --git a/src/object/player.cpp b/src/object/player.cpp index 89984f50d..9647aedb7 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -74,7 +74,7 @@ static const float MAX_WALK_XM = 230; /** maximum run velocity (pixel/s) */ static const float MAX_RUN_XM = 320; /** maximum horizontal climb velocity */ -static const float MAX_CLIMB_XM = 48; +static const float MAX_CLIMB_XM = 96; /** maximum vertical climb velocity */ static const float MAX_CLIMB_YM = 128; /** instant velocity when tux starts to walk */ @@ -1457,12 +1457,16 @@ Player::set_edit_mode(bool enable) void Player::start_climbing(Climbable& climbable) { - if (climbing == &climbable) return; + if (climbing || !&climbable) return; climbing = &climbable; physic.enable_gravity(false); physic.set_velocity(0, 0); physic.set_acceleration(0, 0); + if (backflipping) { + backflipping = false; + backflip_direction = 0; + } } void diff --git a/src/trigger/climbable.cpp b/src/trigger/climbable.cpp index b06f177cb..35ccc0605 100644 --- a/src/trigger/climbable.cpp +++ b/src/trigger/climbable.cpp @@ -26,7 +26,7 @@ namespace { const float GRACE_DX = 8; // how far off may the player's bounding-box be x-wise const float GRACE_DY = 8; // how far off may the player's bounding-box be y-wise const float ACTIVATE_TRY_FOR = 1; // how long to try correcting mis-alignment of player and climbable before giving up -const float POSITION_FIX_AX = 50; // x-wise acceleration applied to player when trying to align player and Climbable +const float POSITION_FIX_AX = 30; // x-wise acceleration applied to player when trying to align player and Climbable const float POSITION_FIX_AY = 50; // y-wise acceleration applied to player when trying to align player and Climbable }