diff --git a/Characters/player.gd b/Characters/player.gd index 909b65f..eda47f7 100755 --- a/Characters/player.gd +++ b/Characters/player.gd @@ -37,10 +37,10 @@ const MIN_LAND_SPEED = 60.0 # Slower impacts than this don't splat. # How long to press opposite direction before unsticking from a wall/ceiling const MAX_SECS_TO_UNSTICK = 0.5 -# Hop: holding up on the floor for MAX_SECS_TO_UNSTICK hops just high enough +# Hop: holding up (and not left/right) on the floor for MAX_SECS_TO_UNSTICK hops just high enough # to reach a ceiling up to HOP_MAX_HEIGHT above us (measured from our top). # With no ceiling in reach it's just a little HOP_NO_CEILING_HEIGHT hop. -const HOP_MAX_HEIGHT = 64.0 +const HOP_MAX_HEIGHT = 32.0 const HOP_NO_CEILING_HEIGHT = 16.0 const HOP_OVERSHOOT = 2.0 # Aim slightly past the ceiling so we still hit it with some speed. var timeSpentHoldingUpOnFloor := 0.0 @@ -166,9 +166,10 @@ func _physics_process(delta: float) -> void: elif not is_on_floor(): velocity.y = minf(velocity.y + get_gravity().y * delta, MAX_FALL_SPEED) - # On the floor, holding up long enough hops up to the ceiling above. Not - # against a wall though, where up climbs it instead. - if is_on_floor() and not isStickingToWall and verticalInput > 0: timeSpentHoldingUpOnFloor += delta + # On the floor and standing still, holding up long enough hops up to the + # ceiling above. Not against a wall though, where up climbs it instead. + if is_on_floor() and not isStickingToWall and verticalInput > 0 and not horizontalInput: + timeSpentHoldingUpOnFloor += delta else: timeSpentHoldingUpOnFloor = 0.0 if timeSpentHoldingUpOnFloor >= MAX_SECS_TO_UNSTICK: timeSpentHoldingUpOnFloor = 0.0