SlimeoosOdyssey/godot/UI/MenuScreen.gd

37 lines
841 B
GDScript3
Raw Permalink Normal View History

2023-08-20 16:48:12 -06:00
extends Control
@onready var play_button = $CenterContainer/HBoxContainer/PlayButton
@onready var credits_button = $CenterContainer/HBoxContainer/CreditsButton
@onready var controls_button = $CenterContainer/HBoxContainer/ControlsButton
@onready var music = $"../Music"
@onready var credits = $Credits
@onready var about = $About
# Called when the node enters the scene tree for the first time.
func _ready():
play_button.grab_focus()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_play_button_pressed():
get_tree().change_scene_to_file("res://Level/Island.tscn")
func _on_credits_button_pressed():
if not credits.visible:
credits.show()
else:
credits.hide()
func _on_controls_button_pressed():
if not about.visible:
about.show()
else:
about.hide()