[gd_scene load_steps=9 format=3 uid="uid://cjbbslcx6vjjy"]

[ext_resource type="Script" uid="uid://b08q3lqbuoolb" path="res://scripts/autoloads/nodes/event_manager.gd" id="1_xplee"]
[ext_resource type="PackedScene" uid="uid://c5wjwnlubyich" path="res://scenes/menus/util/dialog.tscn" id="2_swnhv"]
[ext_resource type="SpriteFrames" uid="uid://bl36fbm1g0x3" path="res://resources/explosion_animation.tres" id="3_gml0k"]
[ext_resource type="AudioStream" uid="uid://d8qefwc57uvj" path="res://assets/audio/sounds/explosion.wav" id="4_ib5t8"]

[sub_resource type="Animation" id="Animation_swnhv"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}

[sub_resource type="Animation" id="Animation_xplee"]
resource_name = "transition"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(0.5, 0.5),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_gml0k"]
_data = {
&"RESET": SubResource("Animation_swnhv"),
&"transition": SubResource("Animation_xplee")
}

[sub_resource type="GDScript" id="GDScript_gml0k"]
script/source = "extends Control

func _ready() -> void:
	hide()

func explode():
	show()
	$AnimatedSprite2D.play(\"default\")
	$AudioStreamPlayer.play()
	await $AnimatedSprite2D.animation_finished
	hide()
"

[node name="EventManager" type="CanvasLayer"]
script = ExtResource("1_xplee")

[node name="ColorRect" type="ColorRect" parent="."]
self_modulate = Color(1, 1, 1, 0)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 1)

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_gml0k")
}

[node name="Dialogue" parent="." instance=ExtResource("2_swnhv")]
visible = false

[node name="Explosion" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = SubResource("GDScript_gml0k")

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Explosion"]
position = Vector2(183.00002, 80.99999)
scale = Vector2(0.54950494, 0.5088008)
sprite_frames = ExtResource("3_gml0k")

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="Explosion"]
stream = ExtResource("4_ib5t8")
