[gd_scene load_steps=15 format=3 uid="uid://bn651dli8j2rj"]

[ext_resource type="Script" uid="uid://dm44kedpj4m80" path="res://Scripts/Classes/Blocks/TurnBlock.gd" id="1_keywi"]
[ext_resource type="Texture2D" uid="uid://btt618edhifoj" path="res://Assets/Sprites/Blocks/TurnBlock.png" id="2_2j2lx"]
[ext_resource type="PackedScene" uid="uid://fqeqexyd7j0j" path="res://Scenes/Prefabs/Particles/TurnBlockDestructionParticles.tscn" id="2_rlxbk"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_wx1p4"]
[ext_resource type="JSON" path="res://Assets/Sprites/Blocks/TurnBlock.json" id="4_keywi"]
[ext_resource type="PackedScene" uid="uid://cijkvfkthetn5" path="res://Scenes/Parts/BlockAnimations.tscn" id="5_xbwt3"]
[ext_resource type="Script" uid="uid://ctfbuoxtnnl0q" path="res://Scripts/Classes/Components/EditorPropertyExposer.gd" id="6_2qcru"]
[ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="7_2j2lx"]

[sub_resource type="AtlasTexture" id="AtlasTexture_8yy4r"]
atlas = ExtResource("2_2j2lx")
region = Rect2(0, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_pm24u"]
atlas = ExtResource("2_2j2lx")
region = Rect2(16, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_keywi"]
atlas = ExtResource("2_2j2lx")
region = Rect2(32, 0, 16, 16)

[sub_resource type="AtlasTexture" id="AtlasTexture_2j2lx"]
atlas = ExtResource("2_2j2lx")
region = Rect2(48, 0, 16, 16)

[sub_resource type="SpriteFrames" id="SpriteFrames_rlxbk"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_8yy4r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pm24u")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_keywi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2j2lx")
}],
"loop": true,
"name": &"default",
"speed": 10.0
}]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_b3g5f"]
size = Vector2(16, 16)

[node name="TurnBlock" type="AnimatableBody2D" node_paths=PackedStringArray("visuals") groups=["Blocks"]]
z_index = -1
collision_layer = 6
collision_mask = 0
script = ExtResource("1_keywi")
visuals = NodePath("Sprite")
destruction_particle_scene = ExtResource("2_rlxbk")
metadata/_custom_type_script = "uid://b5ejlbl0vp1gm"

[node name="Sprite" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_rlxbk")
speed_scale = 0.0

[node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("3_wx1p4")
node_to_affect = NodePath("..")
property_name = "sprite_frames"
resource_json = ExtResource("4_keywi")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"

[node name="Collision" type="CollisionShape2D" parent="."]
visible = false
shape = SubResource("RectangleShape2D_b3g5f")

[node name="BlockAnimations" parent="." instance=ExtResource("5_xbwt3")]

[node name="EditorPropertyExposer" type="Node" parent="."]
script = ExtResource("6_2qcru")
properties = Array[String](["item", "item_amount", "mushroom_if_small"])
filters = Dictionary[String, String]({
"item": "can_be_stored"
})

[node name="TrackJoint" type="Node" parent="."]
script = ExtResource("7_2j2lx")
offset = Vector2(0, 0)
metadata/_custom_type_script = "uid://d4a7yp6e55u8t"

[connection signal="player_block_hit" from="." to="." method="on_block_hit"]
[connection signal="player_block_hit" from="." to="BlockAnimations" method="bounce_block" unbinds=1]
[connection signal="shell_block_hit" from="." to="." method="on_shell_block_hit"]
[connection signal="shell_block_hit" from="." to="BlockAnimations" method="bounce_block" unbinds=1]
