feat: adds a cd to the jump to prevent spam jumping up a slope

This commit is contained in:
DottsGit
2026-06-05 00:54:19 -04:00
parent 9f3264170e
commit 2c35f5074a
7 changed files with 23 additions and 7 deletions
+5
View File
@@ -28,6 +28,7 @@ var on_ground: bool = false
var last_ground_time: float = 0.0
var jump_buffer_time: float = 0.0
var coyote_timer: float = 0.0
var jump_cooldown_timer: float = 0.0
var current_jump_count: int = 0
var chain_timer: float = 0.0
var chain_count: int = 0
@@ -59,6 +60,10 @@ func _physics_process(delta: float) -> void:
jump_buffer_time = params.jump_buffer
else:
jump_buffer_time = maxf(jump_buffer_time - delta, 0.0)
# Update jump cooldown
if jump_cooldown_timer > 0.0:
jump_cooldown_timer = maxf(jump_cooldown_timer - delta, 0.0)
# Update chain timer
if chain_timer > 0.0 and on_ground: