add spawn menu for props

This commit is contained in:
KawaiiZenbo 2025-10-25 16:07:28 -07:00
parent 6e783e0e57
commit b9d16360b9
9 changed files with 231 additions and 62 deletions

View file

@ -46,7 +46,7 @@ var hrx: float = 0
var hry: float = 0
var hrz: float = 0
@onready var interactRay = $Camera/Interact
@onready var interactRay = $Camera/InteractRay
@onready var camera: Camera3D = $Camera
func _ready() -> void:
@ -75,40 +75,46 @@ func _unhandled_input(event: InputEvent) -> void:
release_mouse()
$InGameMenu.visible = true
$InGameMenu/Buttons/ReturnButton.grab_focus()
pass
elif event.is_action_pressed(&"freeroam_debug_menu"):
$DebugMenu.visible = !$DebugMenu.visible
elif event.is_action_pressed(&"freeroam_respawn"):
if (!interact): return
self.position = startPosition
walk_vel = Vector3(0, 0, 0)
jump_vel = Vector3(0, 0, 0)
grav_vel = Vector3(0, 0, 0)
elif event.is_action_pressed(&"freeroam_flashlight_zoom_in"):
if (!interact): return
if ($Camera/Flashlight.visible):
if ($Camera/Flashlight.spot_angle > 2):
$Camera/Flashlight.spot_angle -= 2
$FlashlightSizeSFX.pitch_scale = sqrt($Camera/Flashlight.spot_angle)-0.5
$FlashlightSizeSFX.play()
elif event.is_action_pressed(&"freeroam_flashlight_zoom_out"):
if (!interact): return
if ($Camera/Flashlight.visible):
if ($Camera/Flashlight.spot_angle < 88):
$Camera/Flashlight.spot_angle += 2
$FlashlightSizeSFX.pitch_scale = sqrt($Camera/Flashlight.spot_angle)-0.5
$FlashlightSizeSFX.play()
elif event.is_action_pressed(&"freeroam_flashlight_zoom_reset"):
if (!interact): return
if ($Camera/Flashlight.visible):
$Camera/Flashlight.spot_angle = 30
$FlashlightSizeSFX.pitch_scale = sqrt($Camera/Flashlight.spot_angle)-0.5
$FlashlightSizeSFX.play()
elif event.is_action_pressed(&"freeroam_camera_zoom_in"):
if (!interact): return
if ($Camera.fov > 2):
$Camera.fov -= 2
camera_sens = maxf(camera_sens - 0.1, 0.1)
elif event.is_action_pressed(&"freeroam_camera_zoom_out"):
if (!interact): return
if ($Camera.fov < 178):
$Camera.fov += 2
camera_sens = minf(camera_sens + 0.1, 3)
elif event.is_action_pressed(&"freeroam_camera_zoom_reset"):
if (!interact): return
$Camera.fov = GlobalVariables.FOV
camera_sens = 3