[gd_scene load_steps=12 format=2]

[ext_resource path="res://scripts/pigeon.gd" type="Script" id=1]
[ext_resource path="res://sprites/actors/pigeon.png" type="Texture" id=2]

[sub_resource type="Animation" id=1]
resource_name = "fly"
length = 0.24
loop = true
step = 0.06
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.06, 0.12, 0.18 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 8, 9, 10, 9 ]
}

[sub_resource type="Animation" id=2]
resource_name = "idle"
length = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0.00275932 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 0 ]
}

[sub_resource type="Animation" id=3]
resource_name = "land_on"
length = 0.12
loop = true
step = 0.03
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.03, 0.06, 0.09 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 12, 13, 14, 13 ]
}

[sub_resource type="Animation" id=4]
resource_name = "look"
length = 2.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.4, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 5, 4, 5, 4 ]
}

[sub_resource type="Animation" id=5]
resource_name = "peck"
length = 0.4
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ 0, 6, 0 ]
}

[sub_resource type="Animation" id=6]
resource_name = "rest"
length = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 7 ]
}

[sub_resource type="Animation" id=7]
resource_name = "walk"
length = 0.2
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 3, 2 ]
}

[sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 24, 4 )

[sub_resource type="CircleShape2D" id=9]
radius = 4.0

[node name="pigeon" type="KinematicBody2D"]
script = ExtResource( 1 )

[node name="sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
vframes = 4
hframes = 4

[node name="ray" type="RayCast2D" parent="sprite"]
position = Vector2( 2, 0 )
enabled = true
cast_to = Vector2( 0, 4 )

[node name="ray2" type="RayCast2D" parent="sprite"]
position = Vector2( 2, 0 )
enabled = true
cast_to = Vector2( 4, 0 )

[node name="anim" type="AnimationPlayer" parent="."]
anims/fly = SubResource( 1 )
anims/idle = SubResource( 2 )
anims/land_on = SubResource( 3 )
anims/look = SubResource( 4 )
anims/peck = SubResource( 5 )
anims/rest = SubResource( 6 )
anims/walk = SubResource( 7 )

[node name="area" type="Area2D" parent="."]
collision_layer = 2

[node name="coll" type="CollisionShape2D" parent="area"]
shape = SubResource( 8 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 9 )
disabled = true

[node name="timer" type="Timer" parent="."]
one_shot = true
[connection signal="area_entered" from="area" to="." method="_on_area_area_entered"]
[connection signal="timeout" from="timer" to="." method="_on_timer_timeout"]
