new stimmy flashlight sounds
This commit is contained in:
parent
a7e2ff36fb
commit
1f13716d42
12 changed files with 94 additions and 58 deletions
|
@ -73,19 +73,19 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||
if ($Camera/Flashlight.visible):
|
||||
if ($Camera/Flashlight.spot_angle > 2):
|
||||
$Camera/Flashlight.spot_angle -= 2
|
||||
$FlashlightSFX.pitch_scale = $Camera/Flashlight.spot_angle/10.0
|
||||
$FlashlightSFX.play()
|
||||
$FlashlightSizeSFX.pitch_scale = sqrt($Camera/Flashlight.spot_angle)-0.5
|
||||
$FlashlightSizeSFX.play()
|
||||
elif event.is_action_pressed(&"freeroam_flashlight_zoom_out"):
|
||||
if ($Camera/Flashlight.visible):
|
||||
if ($Camera/Flashlight.spot_angle < 88):
|
||||
$Camera/Flashlight.spot_angle += 2
|
||||
$FlashlightSFX.pitch_scale = $Camera/Flashlight.spot_angle/10.0
|
||||
$FlashlightSFX.play()
|
||||
$FlashlightSizeSFX.pitch_scale = sqrt($Camera/Flashlight.spot_angle)-0.5
|
||||
$FlashlightSizeSFX.play()
|
||||
elif event.is_action_pressed(&"freeroam_flashlight_zoom_reset"):
|
||||
if ($Camera/Flashlight.visible):
|
||||
$Camera/Flashlight.spot_angle = 30
|
||||
$FlashlightSFX.pitch_scale = $Camera/Flashlight.spot_angle/10.0
|
||||
$FlashlightSFX.play()
|
||||
$FlashlightSizeSFX.pitch_scale = sqrt($Camera/Flashlight.spot_angle)-0.5
|
||||
$FlashlightSizeSFX.play()
|
||||
elif event.is_action_pressed(&"freeroam_camera_zoom_in"):
|
||||
if ($Camera.fov > 2):
|
||||
$Camera.fov -= 2
|
||||
|
@ -139,6 +139,8 @@ func _physics_process(delta: float) -> void:
|
|||
running = false
|
||||
elif Input.is_action_just_pressed(&"freeroam_toggle_flashlight"):
|
||||
$Camera/Flashlight.visible = !$Camera/Flashlight.visible
|
||||
if ($Camera/Flashlight.visible): $FlashlightOnSFX.play()
|
||||
else: $FlashlightOffSFX.play()
|
||||
|
||||
if mouse_captured: _handle_joypad_camera_rotation(delta)
|
||||
velocity = _walk(delta) + _gravity(delta) + _jump(delta)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue