extends Node

@onready var level_path = "levels/level_"

func _ready():
	await get_tree().create_timer(2.0).timeout
	$SkyBk.show()
	$ThankYou.show()
	$kitty_boo.show()
	$menu_music.play()
	await get_tree().create_timer(2.0).timeout
	$TotalText.show()
	$CharacterBody2D_level2.show()
	await get_tree().create_timer(2.0).timeout
	$TotalDigits.text = str($"/root/Global".StarTotal)
	$TotalDigits.show()
	$star_pickup.play()
	await get_tree().create_timer(3.0).timeout
	$PlayAgain.show()
	$BackToMenu.show()


func _on_play_again_pressed() -> void:
	$menu_music.stop()
	$star_pickup.play()
	await get_tree().create_timer(1.5).timeout
	get_tree().change_scene_to_file("res://scenes/0-1.tscn")


func _on_back_to_menu_pressed() -> void:
	$menu_music.stop()
	$star_pickup.play()
	await get_tree().create_timer(1.5).timeout
	get_tree().change_scene_to_file("res://start_screen.tscn")
