Various updates

Flashlight, fog, letter shader, safe audio
This commit is contained in:
2023-01-31 19:11:38 +01:00
parent 61a732a698
commit 9b7b25ff94
13 changed files with 162 additions and 30 deletions
+9
View File
@@ -3,6 +3,7 @@ extends CharacterBody3D
const WALK_SPEED = 5.0
const MOUSE_SENS = 0.002
var has_flashlight = false
var mouse_mode = 2
@@ -16,6 +17,8 @@ func _input(event):
elif event.is_action_pressed("mode"):
mouse_mode = mouse_mode ^ 1
Input.set_mouse_mode(mouse_mode)
elif event.is_action_pressed("alt") and has_flashlight:
$Pivot/Camera/FlashLight/SpotLight3D.visible = !$Pivot/Camera/FlashLight/SpotLight3D.visible
func _physics_process(delta):
if mouse_mode == 2:
@@ -24,3 +27,9 @@ func _physics_process(delta):
velocity.x = direction.x * WALK_SPEED
velocity.z = direction.z * WALK_SPEED
move_and_slide()
func _on_flash_light_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Pivot/Camera/FlashLight.visible = true
has_flashlight = true