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

[ext_resource type="Script" uid="uid://yh4pop7sm56c" path="res://Scripts/Classes/Entities/Items/Fireball.gd" id="1_00jom"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="2_gfqet"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/PlayerFireball.json" id="3_an01s"]

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

[sub_resource type="Animation" id="Animation_00jom"]
resource_name = "Spin"
length = 0.4
loop_mode = 1
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:rotation")
tracks/0/interp = 0
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 0,
"values": [0.0, 1.5708, 3.14159, 4.71239, 6.28319]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_an01s"]
_data = {
&"RESET": SubResource("Animation_gfqet"),
&"Spin": SubResource("Animation_00jom")
}

[sub_resource type="RectangleShape2D" id="RectangleShape2D_ajyso"]
size = Vector2(6, 8)

[sub_resource type="CircleShape2D" id="CircleShape2D_dhdpv"]
radius = 8.0

[node name="Fireball" type="CharacterBody2D"]
collision_layer = 0
collision_mask = 2
slide_on_ceiling = false
script = ExtResource("1_00jom")

[node name="Sprite" type="AnimatedSprite2D" parent="."]
z_index = 2

[node name="Animation" type="AnimationPlayer" parent="Sprite"]
libraries = {
&"": SubResource("AnimationLibrary_an01s")
}
autoplay = "Spin"
speed_scale = 2.0

[node name="ResourceSetter" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("2_gfqet")
node_to_affect = NodePath("..")
property_name = "sprite_frames"
resource_json = ExtResource("3_an01s")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"

[node name="Collision" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ajyso")

[node name="Hitbox" type="Area2D" parent="."]
visible = false

[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("CircleShape2D_dhdpv")

[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]

[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="queue_free"]
