]> git.seodisparate.com - LD54/commitdiff
Allow "lighter" jumps by releasing jump early
authorStephen Seo <seo.disparate@gmail.com>
Sun, 1 Oct 2023 05:31:11 +0000 (14:31 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sun, 1 Oct 2023 05:31:11 +0000 (14:31 +0900)
PlayerCharacterBody2D.gd

index 559b436afa253f6820b534abdd4ee74deec26759..20c22050d42c881430a175e4919b10c56acc0a71 100644 (file)
@@ -53,6 +53,9 @@ func _physics_process(delta):
                velocity.y = JUMP_VELOCITY
                jump_sfx.play()
 
+       if Input.is_action_just_released("jump") and velocity.y < 0.0:
+               velocity.y /= 3.0
+
        # Get the input direction and handle the movement/deceleration.
        # As good practice, you should replace UI actions with custom gameplay actions.
        var direction = Input.get_axis("left", "right")