123456789101112131415161718192021 |
- extends Node
- const MENU_FILE: String = "res://run/menu.tscn"
- func _input(event: InputEvent) -> void:
- if event.is_action_pressed("ui_cancel"):
- go_back_to_menu()
- if event.is_action_pressed("ui_accept"):
- toggle_pause()
- func go_back_to_menu():
- get_tree().set_pause(false)
- get_tree().change_scene_to_file(MENU_FILE)
- func toggle_pause():
- var current_status: bool = get_tree().is_paused()
- get_tree().set_pause(!current_status)
|