Now the player cannot jump when there is something in the way

This commit is contained in:
2024-01-20 19:43:41 -08:00
parent 14c731d29a
commit 051b6e837e

View File

@ -120,12 +120,12 @@ func _physics_process(delta):
func handle_jumping(): func handle_jumping():
if jumping_enabled: if jumping_enabled:
if continuous_jumping: if continuous_jumping:
if Input.is_action_pressed(JUMP) and is_on_floor(): if Input.is_action_pressed(JUMP) and is_on_floor() and !low_ceiling:
if jump_animation: if jump_animation:
JUMP_ANIMATION.play("jump") JUMP_ANIMATION.play("jump")
velocity.y += jump_velocity velocity.y += jump_velocity
else: else:
if Input.is_action_just_pressed(JUMP) and is_on_floor(): if Input.is_action_just_pressed(JUMP) and is_on_floor() and !low_ceiling:
if jump_animation: if jump_animation:
JUMP_ANIMATION.play("jump") JUMP_ANIMATION.play("jump")
velocity.y += jump_velocity velocity.y += jump_velocity