Skip to content

Commit

Permalink
Add check if sliding to footstep sound system
Browse files Browse the repository at this point in the history
  • Loading branch information
FailSpy committed Feb 22, 2024
1 parent 575a66f commit 4ae1b12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions COGITO/Scripts/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func _input(event):
# Checking Analog stick input for mouse look
if event is InputEventJoypadMotion and !is_movement_paused:
if event.get_axis() == 2:
joystick_v_event = event
joystick_v_event = event0.0
if event.get_axis() == 3:
joystick_h_event = event

Expand Down Expand Up @@ -441,6 +441,7 @@ func _physics_process(delta):
head.position.y = lerp(head.position.y, 0.0, delta * LERP_SPEED)
carryable_position.position.y = lerp(carryable_position.position.y, initial_carryable_height, delta * LERP_SPEED)
if head.position.y < CROUCHING_DEPTH/4:
# still transitioning from state
crouching_collision_shape.disabled = false
standing_collision_shape.disabled = true
else:
Expand Down Expand Up @@ -736,7 +737,10 @@ func _physics_process(delta):

# FOOTSTEP SOUNDS SYSTEM = CHECK IF ON GROUND AND MOVING
if is_on_floor() and velocity.length() >= 0.2:
if footstep_timer.time_left <= 0:
if sliding_timer.is_stopped():
# TODO: Add slide sound effects. For now, mute it
pass
elif footstep_timer.time_left <= 0:
#dynamic volume for footsteps
if is_walking:
footstep_player.volume_db = walk_volume_db
Expand Down

1 comment on commit 4ae1b12

@FailSpy
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops @ change on line 206 there. Force pushed a different version

Please sign in to comment.