[gd_scene load_steps=11 format=3 uid="uid://bnwvtlsvxjmel"]

[ext_resource type="Script" path="res://entities/scripts/snail.gd" id="1_lkvd1"]
[ext_resource type="Script" path="res://entities/scripts/finite_state_machine.gd" id="1_tejvt"]
[ext_resource type="Texture2D" uid="uid://dh8fo7865wgs" path="res://resources/textures/snail.png" id="2_yor00"]
[ext_resource type="Script" path="res://entities/snail/states/snail_sleeping.gd" id="3_wnrnl"]
[ext_resource type="Script" path="res://entities/snail/states/snail_eating.gd" id="4_1abwi"]
[ext_resource type="Texture2D" uid="uid://d30yqtob6phcj" path="res://resources/textures/snail_body.png" id="7_8spp3"]
[ext_resource type="Texture2D" uid="uid://5vt8eaihmut3" path="res://resources/textures/snail_shell.png" id="8_0v3d4"]

[sub_resource type="Animation" id="Animation_kpiuy"]
resource_name = "GoingToSleep"
length = 1.5
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite/SnailBody:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.3, 1.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(0, 0), Vector2(0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprite/SnailShell:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.1, 1, 1.1, 1.2, 1.3, 1.4, 1.5),
"transitions": PackedFloat32Array(1, -2, 1, 1, 1, 1, 1),
"update": 0,
"values": [0.0, -6.28319, -6.10865, -6.28319, -6.10865, -6.28319, -6.28319]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Sprite/SnailShell:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.1, 0.6, 1, 1.5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0, -300), Vector2(0, 0), Vector2(0, 0)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Sprite/SnailBody:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.4, 0.6, 1.5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(60, 30), Vector2(60, -300), Vector2(60, 30), Vector2(60, 30)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Sprite/ShadowEating:scale")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.3, 1.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(1.09451, 0.620219), Vector2(0, 0), Vector2(0, 0)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_6ntaf"]
_data = {
"GoingToSleep": SubResource("Animation_kpiuy")
}

[sub_resource type="CircleShape2D" id="CircleShape2D_2whjo"]
radius = 42.0476

[node name="Snail" type="CharacterBody2D"]
collision_layer = 8
collision_mask = 8
input_pickable = true
script = ExtResource("1_lkvd1")

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

[node name="Sprite" type="Sprite2D" parent="."]
position = Vector2(-6, 0)
scale = Vector2(0.1, 0.1)

[node name="SnailBody" type="Sprite2D" parent="Sprite"]
position = Vector2(60, 30)
scale = Vector2(1e-05, 1e-05)
texture = ExtResource("7_8spp3")

[node name="SnailShell" type="Sprite2D" parent="Sprite"]
position = Vector2(0, -168.582)
rotation = -4.71395
scale = Vector2(1, 1)
texture = ExtResource("8_0v3d4")

[node name="ShadowEating" type="Sprite2D" parent="Sprite"]
self_modulate = Color(0, 0, 0, 0.0784314)
show_behind_parent = true
position = Vector2(121, 68.925)
scale = Vector2(1e-05, 1e-05)
texture = ExtResource("2_yor00")

[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("initial_state")]
script = ExtResource("1_tejvt")
initial_state = NodePath("Eating")

[node name="Sleeping" type="Node" parent="StateMachine"]
script = ExtResource("3_wnrnl")

[node name="Eating" type="Node" parent="StateMachine"]
script = ExtResource("4_1abwi")

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