43 lines
987 B
GDScript
43 lines
987 B
GDScript
extends Control
|
|
@onready var option_popup = $OptionPopup
|
|
@onready var back_button = $TextureRect/back
|
|
func _ready():
|
|
$TextureRect/start.connect("pressed", Callable(self, "_on_start_pressed"))
|
|
$TextureRect/exit.connect("pressed", Callable(self, "_on_exit_pressed"))
|
|
$TextureRect/option.connect("pressed", Callable(self, "_on_opcje_pressed"))
|
|
$TextureRect/back.connect("pressed", Callable(self, "_on_back_pressed"))
|
|
|
|
|
|
|
|
if GameData.game_lunched == true:
|
|
back_button.visible = true
|
|
else :
|
|
MusicManager.play_music()
|
|
back_button.visible = false
|
|
|
|
|
|
|
|
|
|
func _on_opcje_pressed():
|
|
option_popup.popup_centered()
|
|
|
|
|
|
func _on_start_pressed():
|
|
|
|
get_tree().change_scene_to_file("res://scenes/galaxy.tscn")
|
|
|
|
|
|
func _on_exit_pressed():
|
|
get_tree().quit()
|
|
|
|
func _on_back_pressed():
|
|
var cam = get_parent().get_node_or_null("Camera2D")
|
|
if cam:
|
|
cam.enabled = true
|
|
cam.make_current() # ustawia kamerę jako aktywną
|
|
|
|
get_tree().paused = false
|
|
queue_free() # usuwa menu z ekranu
|
|
|
|
|