Switch scenes on button press

This commit is contained in:
Your Name
2025-07-19 21:24:38 +04:00
parent e3e9d5591d
commit 877b5fc14f
3 changed files with 20 additions and 1 deletions

16
scripts/Main.gd Normal file
View File

@@ -0,0 +1,16 @@
extends Control
@onready var press_any_key_screen = $PressAnyKeyScreen
func _ready():
print("Main scene ready")
# Connect the press any key signal
press_any_key_screen.any_key_pressed.connect(_on_any_key_pressed)
func _on_any_key_pressed():
print("Transitioning to main menu")
# Remove the press any key screen
press_any_key_screen.queue_free()
# Load and add the main menu
var main_menu = preload("res://ui/MainMenu.tscn").instantiate()
add_child(main_menu)

1
scripts/Main.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://cwlop1ettlqhg