extends Node3D

@onready var bubble_shadow: AnimatedSprite3D = $"../BubbleShadow"
@onready var animated_sprite_3d: AnimatedSprite3D = $"../AnimatedSprite3D"
@onready var explode: AnimatedSprite3D = $"../Explode"
@onready var eyes: AnimatedSprite3D = $"../../Sprites/Eyes"
@onready var mouth: AnimatedSprite3D = $"../../Sprites/Mouth"
@onready var shine: AnimatedSprite3D = $"../../Sprites/Shine"
@onready var wind: AnimatedSprite3D = $"../../Sprites/Wind"

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	GameVariables.game_over.connect(die)


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


func bubbly():
	pass

func die():
	bubble_shadow.visible = false
	animated_sprite_3d.visible = false
	eyes.visible = false
	mouth.visible = false
	shine.visible = false
	wind.visible = false
	explode.visible = true
	explode.play("explode")
	await get_tree().create_timer(0.5).timeout
	explode.visible = false
	await get_tree().create_timer(1).timeout
	get_tree().quit()	
