41 lines
831 B
GDScript
41 lines
831 B
GDScript
extends CanvasLayer
|
|
|
|
onready var options_screen = $OptionsScreen
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
get_tree().paused = true
|
|
$Body/Resume.grab_focus()
|
|
|
|
func _physics_process(delta):
|
|
#Resume with pause button
|
|
if Input.is_action_just_pressed("pause"):
|
|
queue_free()
|
|
get_tree().paused = false
|
|
|
|
Debug.print(get_tree().paused)
|
|
|
|
func _on_Resume_pressed():
|
|
get_tree().paused = false
|
|
queue_free()
|
|
|
|
|
|
func _on_Restart_pressed():
|
|
Game.call_deferred("restart_level")
|
|
get_tree().paused = false
|
|
queue_free()
|
|
|
|
|
|
func _on_Settings_pressed():
|
|
options_screen.focus()
|
|
|
|
|
|
func _on_ExitLevel_pressed():
|
|
get_tree().paused = false
|
|
Game.change_map(load("res://maps/level_select.tscn"))
|
|
queue_free()
|
|
|
|
|
|
func _on_OptionsScreen_exit():
|
|
options_screen.visible = false
|
|
$Body/Settings.grab_focus()
|