diff --git a/back_to_main.gd b/back_to_main.gd new file mode 100644 index 0000000..2df2452 --- /dev/null +++ b/back_to_main.gd @@ -0,0 +1,6 @@ +extends Node +var main_menue: PackedScene = preload("res://main.tscn") + +func _input(event: InputEvent) -> void: + if event.is_action_pressed("main_menue"): + get_tree().change_scene_to_packed(main_menue) diff --git a/back_to_main.gd.uid b/back_to_main.gd.uid new file mode 100644 index 0000000..e64f88f --- /dev/null +++ b/back_to_main.gd.uid @@ -0,0 +1 @@ +uid://c6n4axv3eoguq diff --git a/project.godot b/project.godot index 4a70f12..0ae9d7d 100644 --- a/project.godot +++ b/project.godot @@ -16,6 +16,10 @@ config/features=PackedStringArray("4.5", "Forward Plus") boot_splash/bg_color=Color(0, 0, 0, 1) config/icon="res://icon.svg" +[autoload] + +BackToMain="*res://back_to_main.gd" + [input] w={ @@ -48,6 +52,11 @@ e={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) ] } +main_menue={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} [physics]