cool stuff
This commit is contained in:
parent
a9be913adb
commit
44be9924a6
11 changed files with 202 additions and 29 deletions
|
|
@ -8,12 +8,17 @@ extends Control
|
|||
@export var level_title : Label
|
||||
@export var clock_progress : TextureProgressBar
|
||||
@export var clock_label : Label
|
||||
@export var volume_slider : HSlider
|
||||
@export var level_name : Label
|
||||
@export var pause_menu : MarginContainer
|
||||
|
||||
var title_fade : float = 2.5
|
||||
var sound = AudioServer.get_bus_index("Master")
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
lose_panel.visible = false
|
||||
volume_slider.value = db_to_linear(AudioServer.get_bus_volume_db(sound))
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
|
|
@ -37,6 +42,7 @@ func hide_lose_screen():
|
|||
|
||||
func show_level_title(title : String):
|
||||
level_title.text = title
|
||||
level_name.text = title
|
||||
title_fade = 2
|
||||
|
||||
func onTick(tick : int):
|
||||
|
|
@ -45,3 +51,20 @@ func onTick(tick : int):
|
|||
clock_label.text = str(10)
|
||||
else:
|
||||
clock_label.text = str(tick)
|
||||
|
||||
func open_pause():
|
||||
pause_menu.show()
|
||||
|
||||
func close_pause():
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
pause_menu.hide()
|
||||
get_parent().process_mode = Node.PROCESS_MODE_INHERIT
|
||||
|
||||
|
||||
func goto_menu():
|
||||
get_tree().change_scene_to_file(GameManager.menu_scene_path)
|
||||
|
||||
|
||||
func _on_h_slider_value_changed(value: float) -> void:
|
||||
AudioServer.set_bus_volume_db(sound, linear_to_db(value))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue