big
This commit is contained in:
@@ -104,6 +104,7 @@ func update(delta: float) -> void:
|
||||
machine.jump_cooldown_timer = params.jump_cooldown
|
||||
machine.current_jump_count += 1
|
||||
machine.register_chain_mechanic("double_jump")
|
||||
machine.movement_event.emit("double_jump", {})
|
||||
if player.double_jump_player:
|
||||
player.double_jump_player.play()
|
||||
return
|
||||
|
||||
@@ -81,13 +81,8 @@ func update(delta: float) -> void:
|
||||
if current_hspeed > 1.0 and player.is_on_floor():
|
||||
_footstep_timer -= delta
|
||||
if _footstep_timer <= 0.0:
|
||||
if player.footstep_player:
|
||||
# Random sample + slight pitch variation so steps don't machine-gun.
|
||||
if "footstep_streams" in player and not player.footstep_streams.is_empty():
|
||||
player.footstep_player.stream = player.footstep_streams.pick_random()
|
||||
player.footstep_player.pitch_scale = randf_range(0.92, 1.08)
|
||||
player.footstep_player.volume_db = -6.0
|
||||
player.footstep_player.play()
|
||||
if player.has_method("play_footstep"):
|
||||
player.play_footstep(current_hspeed)
|
||||
_footstep_timer = max(0.2, 3.0 / current_hspeed)
|
||||
else:
|
||||
_footstep_timer = 0.0
|
||||
|
||||
@@ -23,6 +23,8 @@ func enter(_data: Dictionary = {}) -> void:
|
||||
|
||||
# Slide in the direction of current velocity (momentum-based)
|
||||
var hvel := Vector3(machine.player.velocity.x, 0.0, machine.player.velocity.z)
|
||||
if machine.player.has_method("update_slide_audio"):
|
||||
machine.player.update_slide_audio(hvel.length())
|
||||
if hvel.length_squared() > 0.01:
|
||||
_slide_direction = hvel.normalized()
|
||||
else:
|
||||
@@ -57,6 +59,8 @@ func update(delta: float) -> void:
|
||||
var vel: Vector3 = player.velocity
|
||||
var hvel := Vector3(vel.x, 0.0, vel.z)
|
||||
var hspeed := hvel.length()
|
||||
if player.has_method("update_slide_audio"):
|
||||
player.update_slide_audio(hspeed)
|
||||
|
||||
# ── Slope physics: gravity projected along the floor plane ────────────
|
||||
var on_slope := false
|
||||
|
||||
@@ -27,6 +27,8 @@ func enter(_data: Dictionary = {}) -> void:
|
||||
machine.player.wallrun_player.play()
|
||||
|
||||
var hvel := Vector3(machine.player.velocity.x, 0.0, machine.player.velocity.z)
|
||||
if machine.player.has_method("update_wallrun_audio"):
|
||||
machine.player.update_wallrun_audio(hvel.length(), machine.wall_normal)
|
||||
_current_tangent = machine.wall_normal.cross(Vector3.UP).normalized()
|
||||
if hvel.dot(_current_tangent) < 0.0:
|
||||
_current_tangent = -_current_tangent
|
||||
@@ -71,6 +73,8 @@ func update(delta: float) -> void:
|
||||
|
||||
var hvel := Vector3(vel.x, 0.0, vel.z)
|
||||
var along := hvel.dot(wall_tangent)
|
||||
if player.has_method("update_wallrun_audio"):
|
||||
player.update_wallrun_audio(hvel.length(), machine.wall_normal)
|
||||
var target_speed: float = maxf(machine.get_effective_speed(params.wall_run_speed), along)
|
||||
along = move_toward(along, target_speed, params.wall_run_accel * delta)
|
||||
# Redirect all horizontal velocity along the wall (kills the into-wall part)
|
||||
|
||||
Reference in New Issue
Block a user