[gd_scene load_steps=8 format=2]

[ext_resource path="res://assets/enemy/Caterpilllar.png" type="Texture" id=1]
[ext_resource path="res://src/Actors/Enemies/Caterpillar.gd" type="Script" id=2]
[ext_resource path="res://src/StateMachines/CaterpillarStateMachine.gd" type="Script" id=3]

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 13.3735, 3.49085 )

[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 15, 8.61814 )

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 14.7108, 7.85442 )

[sub_resource type="Animation" id=4]
resource_name = "moving"
loop = true
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath("enemy:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.25, 0.5, 0.75 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 1, 1 ), Vector2( 1.05, 1 ), Vector2( 1.1, 1.05 ), Vector2( 1.05, 1.1 ) ]
}

[node name="Caterpillar" type="KinematicBody2D" groups=["frogfood", "harmful"]]
scale = Vector2( 0.747749, 0.572926 )
collision_layer = 258
collision_mask = 9
collision/safe_margin = 0.001
script = ExtResource( 2 )
killable = false

[node name="enemy" type="Sprite" parent="."]
position = Vector2( 0, -3.49085 )
scale = Vector2( 1.01, 1.02 )
texture = ExtResource( 1 )

[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."]
visible = false
position = Vector2( 1362.81, -0.138177 )
scale = Vector2( 15.4865, 1.28502 )
rect = Rect2( -89, -10, 2, 20 )
process_parent = true
physics_process_parent = true

[node name="SlopeRaycastLeft" type="RayCast2D" parent="."]
visible = false
position = Vector2( -7.5, 12 )
enabled = true
cast_to = Vector2( 0, 2 )
collision_mask = 8

[node name="SlopeRaycastRight" type="RayCast2D" parent="."]
visible = false
position = Vector2( 7.5, 12 )
enabled = true
cast_to = Vector2( 0, 2 )
collision_mask = 8

[node name="WallRaycastLeft" type="RayCast2D" parent="."]
visible = false
position = Vector2( -14.711, 11.5 )
enabled = true
cast_to = Vector2( -3, 0 )
collision_mask = 8

[node name="WallRaycastRight" type="RayCast2D" parent="."]
visible = false
position = Vector2( 14.711, 11.5 )
enabled = true
cast_to = Vector2( 3, 0 )
collision_mask = 8

[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
modulate = Color( 0, 0.0392157, 1, 1 )
light_mask = 0
position = Vector2( 0, 5.23628 )
collision_layer = 2
input_pickable = false
monitorable = false
priority = 1.0

[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"]
position = Vector2( 0, -2.28618 )
shape = SubResource( 2 )

[node name="EnemySkin" type="Area2D" parent="."]
process_priority = -1
collision_layer = 2
collision_mask = 127
input_pickable = false

[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"]
position = Vector2( 0, 3.49085 )
shape = SubResource( 3 )

[node name="EnemyBody" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( -6.37697e-07, 4.36357 )
shape = SubResource( 1 )

[node name="StateMachine" type="Node2D" parent="."]
visible = false
script = ExtResource( 3 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/moving = SubResource( 4 )

[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"]
[connection signal="body_entered" from="EnemySkin" to="." method="_on_EnemySkin_body_entered"]
