28 lines
963 B
GDScript
28 lines
963 B
GDScript
# Copyright 2021 Outfrost
|
|
# This work is free software. It comes without any warranty, to the extent
|
|
# permitted by applicable law. You can redistribute it and/or modify it under
|
|
# the terms of the Do What The Fuck You Want To Public License, Version 2,
|
|
# as published by Sam Hocevar. See the LICENSE file for more details.
|
|
|
|
extends Control
|
|
|
|
signal start_game()
|
|
|
|
onready var play_button: Button = find_node("PlayButton")
|
|
onready var credits_button: Button = find_node("CreditsButton")
|
|
onready var quit_button: Button = find_node("QuitButton")
|
|
onready var credits_popup: Popup = $CreditsPopup
|
|
|
|
func _ready() -> void:
|
|
play_button.connect("pressed", self, "on_play_pressed")
|
|
credits_button.connect("pressed", self, "on_credits_pressed")
|
|
quit_button.connect("pressed", self, "on_quit_pressed")
|
|
|
|
func on_play_pressed() -> void:
|
|
emit_signal("start_game")
|
|
|
|
func on_credits_pressed() -> void:
|
|
credits_popup.show()
|
|
|
|
func on_quit_pressed() -> void:
|
|
get_tree().quit()
|