18 lines
600 B
GDScript
18 lines
600 B
GDScript
extends Node
|
|
|
|
@onready var back_button: Button = $BackButtonContainer/BackButton
|
|
# Fixed: Use static Match3 instance from scene instead of dynamic loading
|
|
@onready var match3_instance: Node = $Match3
|
|
|
|
func _ready() -> void:
|
|
if not back_button.pressed.is_connected(_on_back_button_pressed):
|
|
back_button.pressed.connect(_on_back_button_pressed)
|
|
# Fixed: No need to load match3 scene - it's already in the scene tree
|
|
|
|
|
|
func _on_back_button_pressed() -> void:
|
|
AudioManager.play_ui_click()
|
|
GameManager.save_game()
|
|
# Fixed: Don't free the static instance, just exit
|
|
GameManager.exit_to_main_menu()
|