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
+3 -1
View File
@@ -48,12 +48,14 @@ func update(delta: float) -> void:
return
# ── Jump off wall ─────────────────────────────────────────────────────
if machine.input_jump_just_pressed:
if machine.input_jump_just_pressed and machine.jump_cooldown_timer <= 0.0:
var push_dir := machine.wall_normal * params.wall_run_jump_off_normal
player.velocity = Vector3(push_dir.x, params.jump_velocity, push_dir.z)
machine.wall_normal = Vector3.ZERO
machine.wall_side = 0.0
machine.wall_cooldown_timer = 0.3
machine.register_chain_mechanic("wall_cling_jump")
machine.jump_cooldown_timer = params.jump_cooldown
machine.switch_to("air")
return