TowerDefense/game_menu.gd

30 lines
626 B
GDScript

extends Control
var selected_tower
func _ready() -> void:
EventBus.tower_selected.connect(_on_EventBus_tower_selected)
EventBus.open_shop.connect(open_shop)
EventBus.close_shop.connect(close_shop)
func open_shop():
if visible:
close_shop()
return
visible = true
func close_shop():
visible = false
func _on_EventBus_tower_selected(tower : PackedScene):
selected_tower = tower
func _on_button_return_desktop_pressed() -> void:
get_tree().quit()
func _on_button_back_to_start_screen_pressed() -> void:
Transition.goto("res://UI/start_menu.tscn")
func _on_button_continue_pressed() -> void:
visible = false