From 09da6e9f3e8f6d6a1d3524edbc52bcc703813549 Mon Sep 17 00:00:00 2001 From: Jakob Feldmann Date: Mon, 25 Sep 2023 19:53:49 +0200 Subject: [PATCH] fix: initially wrong wall touch direction when wallsliding --- src/Actors/Blobby/Blobby.gd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Actors/Blobby/Blobby.gd b/src/Actors/Blobby/Blobby.gd index 44f31eb..2368bf9 100644 --- a/src/Actors/Blobby/Blobby.gd +++ b/src/Actors/Blobby/Blobby.gd @@ -211,11 +211,12 @@ func is_touching_wall_completely() -> bool: # Attached to wall state is in the PlayerStateMachine func is_correct_walljump_input(direction: Vector2) -> bool: - return ( - Input.is_action_pressed("jump") - && abs(direction.x + wall_touch_direction) < 1 - && abs(direction.x + wall_touch_direction) >= 0 - ) + if is_touching_wall_completely(): + return( Input.is_action_pressed("jump") + && abs(direction.x + wall_touch_direction) < 1 + && abs(direction.x + wall_touch_direction) >= 0 + ) + return false func is_correct_airstrafe_input() -> bool: