extends Node2D

var buttton_type=null
 
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass


func _on_start_pressed() -> void:
	buttton_type="start"
	$Fade_transitions.show()
	$Fade_transitions/FadeTimer.start()
	$Fade_transitions/AnimationPlayer.play("Fade_in")
	$AudioStreamPlayer2D.stop()
	$AudioStreamPlayer2D2.play(0)
	

func _on_options_pressed() -> void:
	buttton_type="options"
	$Fade_transitions.show()
	$Fade_transitions/FadeTimer.start()
	$Fade_transitions/AnimationPlayer.play("Fade_in")
	$AudioStreamPlayer2D.stop()
	$AudioStreamPlayer2D2.play(0)


func _on_quit_pressed() -> void:
	get_tree().quit()
	$AudioStreamPlayer2D.stop()


func _on_fade_timer_timeout() -> void:
	if buttton_type== "start":
		get_tree().change_scene_to_file("res://scenes/Main.tscn")
	elif buttton_type== "options":
		get_tree().change_scene_to_file("res://scenes/Options.tscn")
