Moved Scripts to proper place

This commit is contained in:
Willow Behar
2024-05-13 18:16:36 -05:00
parent 0cd8413a19
commit 724c66ba9d
4 changed files with 2 additions and 2 deletions

View File

@ -0,0 +1,39 @@
extends Control
signal paused
signal unpaused
func _ready():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
func _input(event):
if event.is_action_pressed("quit"):
pause_game_button()
func pause_game_button():
if $Settings.visible:
$Settings.hide()
$"Pause Menu".show()
elif $"Pause Menu".visible:
$"Pause Menu".hide()
hide()
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
emit_signal("unpaused")
else:
show()
$"Pause Menu".show()
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
emit_signal("paused")
func _on_quit_pressed():
get_tree().quit()
func _on_resume_pressed():
pause_game_button()
func _on_settings_pressed():
$"Pause Menu".hide()
$"Settings".show()

View File

@ -0,0 +1,27 @@
extends SpotLight3D
var Power = 0.0
var MaxPow = 10
var is_vaping = false
func _ready():
light_energy = 0
func _process(delta):
if is_vaping:
if light_energy < MaxPow:
light_energy += 1 * delta
else:
if light_energy > 0:
light_energy -= .1
if light_energy <= 0:
hide()
if light_energy > 0:
show()
func on():
is_vaping = true
func off():
is_vaping = false