feat: adds a cd to the jump to prevent spam jumping up a slope
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user