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

[ext_resource type="Texture2D" uid="uid://ccs76qyn4ua40" path="res://puzzles/assets/ball.png" id="1_3p6vy"]
[ext_resource type="Script" path="res://puzzles/ball/ball.gd" id="1_8r0ul"]

[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_8in3v"]

[sub_resource type="Animation" id="Animation_2lwo2"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D: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_r6vqa"]
resource_name = "roll"
length = 3.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 6.28319]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_srpra"]
_data = {
"RESET": SubResource("Animation_2lwo2"),
"roll": SubResource("Animation_r6vqa")
}

[sub_resource type="RectangleShape2D" id="RectangleShape2D_we7nh"]
size = Vector2(14, 14)

[sub_resource type="CircleShape2D" id="CircleShape2D_eid6d"]
radius = 7.0

[node name="Ball" type="StaticBody2D"]
physics_material_override = SubResource("PhysicsMaterial_8in3v")
script = ExtResource("1_8r0ul")

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_srpra")
}
autoplay = "roll"

[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_3p6vy")

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

[node name="RayCast2D" type="RayCast2D" parent="."]
target_position = Vector2(8, 0)

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

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("CircleShape2D_eid6d")

[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="area_entered" from="Area2D" to="." method="_on_area_entered"]
