Adding pause screen and updating music files
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var paused:bool = false
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
process_mode = Node.PROCESS_MODE_ALWAYS
|
||||
hide()
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if Input.is_key_pressed(KEY_ESCAPE) and paused == false:
|
||||
await get_tree().create_timer(0.25).timeout
|
||||
paused = true
|
||||
get_tree().paused = true
|
||||
show()
|
||||
elif Input.is_key_pressed(KEY_ESCAPE) and paused == true:
|
||||
await get_tree().create_timer(0.25).timeout
|
||||
paused = false
|
||||
get_tree().paused = false
|
||||
hide()
|
||||
Reference in New Issue
Block a user