feat: implement persistent settings manager, add character movement controller, and create FPS map blockout scene
This commit is contained in:
@@ -8,6 +8,7 @@ signal chain_updated(count: int, bonus: float)
|
||||
var _machine: MovementStateMachine = null
|
||||
var head_pivot: Node3D = null # FPSCameraRig node
|
||||
var camera: Camera3D = null
|
||||
var flashlight: SpotLight3D = null
|
||||
var _damage_layer: CanvasLayer = null
|
||||
|
||||
# Health and Shield
|
||||
@@ -81,6 +82,17 @@ func _ready() -> void:
|
||||
head_pivot = get_node_or_null("HeadPivot")
|
||||
if head_pivot:
|
||||
camera = head_pivot.get_node_or_null("Camera3D")
|
||||
|
||||
if camera:
|
||||
flashlight = SpotLight3D.new()
|
||||
flashlight.spot_range = 100.0
|
||||
flashlight.spot_angle = 35.0
|
||||
flashlight.light_energy = 5.0
|
||||
flashlight.light_volumetric_fog_energy = 0.0 # Prevents the blinding fog glare and laggy trails
|
||||
flashlight.shadow_enabled = false
|
||||
flashlight.position = Vector3(0, 0, 0)
|
||||
flashlight.visible = false
|
||||
camera.add_child(flashlight)
|
||||
|
||||
_setup_audio()
|
||||
_setup_grapple()
|
||||
@@ -652,6 +664,9 @@ func _physics_process(_delta: float) -> void:
|
||||
var input_grapple = Input.is_action_pressed("grapple")
|
||||
var input_grapple_just = Input.is_action_just_pressed("grapple")
|
||||
|
||||
if Input.is_action_just_pressed("toggle_flashlight") and is_instance_valid(flashlight):
|
||||
flashlight.visible = !flashlight.visible
|
||||
|
||||
server_receive_inputs.rpc_id(1, raw_input, world_dir, input_jump, input_jump_just, input_crouch, input_dash, input_grapple, input_grapple_just)
|
||||
|
||||
var speed = velocity.length()
|
||||
|
||||
Reference in New Issue
Block a user