Moved is_paused from player to GlobalSettings so that other game functions knows when it's paused

This commit is contained in:
2024-08-15 02:02:09 -05:00
parent 939399e2da
commit bcd7a629a2
3 changed files with 8 additions and 8 deletions

View File

@ -21,13 +21,11 @@ var vapes_per_min = 0
var mouse_sensitivity = 0.02
var joystick_sensitity = 2
var is_paused = false
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
func _physics_process(delta):
if not is_paused:
if not GlobalSettings.is_paused:
# Add the gravity.
if not is_on_floor():
velocity.y -= gravity * delta
@ -60,7 +58,7 @@ func _process(delta):
if vapes_per_min == randi_range(10,20):
will_cough = true
vapes_per_min = 0
if is_paused:
if GlobalSettings.is_paused:
$Head/Crosshair.hide()
$Head/RayCast3D/Prompt.hide()
elif not $Head/Crosshair.visible:
@ -70,7 +68,7 @@ func _process(delta):
func _input(event):
if event.is_action("ui_text_backspace"):
respawn()
if not is_paused:
if not GlobalSettings.is_paused:
if event is InputEventMouseMotion:
rotate_y(-event.relative.x * (GlobalSettings.GetSetting(GlobalSettings.Setting.Mouse_Speed)) / 100)