summaryrefslogtreecommitdiffstats
path: root/Chicken.tscn
diff options
context:
space:
mode:
Diffstat (limited to 'Chicken.tscn')
-rw-r--r--Chicken.tscn129
1 files changed, 79 insertions, 50 deletions
diff --git a/Chicken.tscn b/Chicken.tscn
index 835d872..a099de4 100644
--- a/Chicken.tscn
+++ b/Chicken.tscn
@@ -1,10 +1,12 @@
-[gd_scene load_steps=50 format=2]
+[gd_scene load_steps=53 format=2]
[ext_resource path="res://chicken.tres" type="Material" id=1]
[ext_resource path="res://beak.tres" type="Material" id=2]
[ext_resource path="res://Chicken.gd" type="Script" id=3]
-[ext_resource path="res://ChickenAnimation.gd" type="Script" id=4]
[ext_resource path="res://SmoothRotation.gd" type="Script" id=5]
+[ext_resource path="res://Detection.gd" type="Script" id=6]
+
+[sub_resource type="CapsuleShape" id=71]
[sub_resource type="SphereMesh" id=1]
@@ -18,7 +20,7 @@
length = 0.001
loop = true
tracks/0/type = "value"
-tracks/0/path = NodePath("Belly/LeftWingPivot:translation")
+tracks/0/path = NodePath("Model/Belly/LeftWingPivot:translation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
@@ -30,7 +32,7 @@ tracks/0/keys = {
"values": [ Vector3( -0.995677, 0, 0 ) ]
}
tracks/1/type = "value"
-tracks/1/path = NodePath("Belly/LeftWingPivot:rotation_degrees")
+tracks/1/path = NodePath("Model/Belly/LeftWingPivot:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@@ -42,7 +44,7 @@ tracks/1/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/2/type = "value"
-tracks/2/path = NodePath("Belly/RightWingPivot:translation")
+tracks/2/path = NodePath("Model/Belly/RightWingPivot:translation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@@ -54,7 +56,7 @@ tracks/2/keys = {
"values": [ Vector3( 0.996, 0, 0 ) ]
}
tracks/3/type = "value"
-tracks/3/path = NodePath("Belly/RightWingPivot:rotation_degrees")
+tracks/3/path = NodePath("Model/Belly/RightWingPivot:rotation_degrees")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@@ -66,7 +68,7 @@ tracks/3/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/4/type = "value"
-tracks/4/path = NodePath("Belly/HeadPivot:rotation_degrees")
+tracks/4/path = NodePath("Model/Belly/HeadPivot:rotation_degrees")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@@ -78,7 +80,7 @@ tracks/4/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/5/type = "value"
-tracks/5/path = NodePath("Belly/HeadPivot/Head/BeakTopPivot:rotation_degrees")
+tracks/5/path = NodePath("Model/Belly/HeadPivot/Head/BeakTopPivot:rotation_degrees")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
@@ -90,7 +92,7 @@ tracks/5/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/6/type = "value"
-tracks/6/path = NodePath("Belly/HeadPivot/Head/BeakBottomPivot:rotation_degrees")
+tracks/6/path = NodePath("Model/Belly/HeadPivot/Head/BeakBottomPivot:rotation_degrees")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/imported = false
@@ -102,7 +104,7 @@ tracks/6/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/7/type = "value"
-tracks/7/path = NodePath("Belly:rotation_degrees")
+tracks/7/path = NodePath("Model/Belly:rotation_degrees")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/imported = false
@@ -114,7 +116,7 @@ tracks/7/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/8/type = "value"
-tracks/8/path = NodePath("Belly:translation")
+tracks/8/path = NodePath("Model/Belly:translation")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/imported = false
@@ -131,7 +133,7 @@ resource_name = "flappybird"
length = 2.0
loop = true
tracks/0/type = "value"
-tracks/0/path = NodePath("Belly/LeftWingPivot:translation")
+tracks/0/path = NodePath("Model/Belly/LeftWingPivot:translation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
@@ -143,7 +145,7 @@ tracks/0/keys = {
"values": [ Vector3( -0.995677, 0, 0 ), Vector3( -0.995677, 0.0845447, 0 ), Vector3( -0.995677, -0.127906, 0 ), Vector3( -0.995677, 0, 0 ) ]
}
tracks/1/type = "value"
-tracks/1/path = NodePath("Belly/LeftWingPivot:rotation_degrees")
+tracks/1/path = NodePath("Model/Belly/LeftWingPivot:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@@ -155,7 +157,7 @@ tracks/1/keys = {
"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 0, -23.821 ), Vector3( 0, 0, 21.829 ), Vector3( 0, 0, 0 ) ]
}
tracks/2/type = "value"
-tracks/2/path = NodePath("Belly/RightWingPivot:translation")
+tracks/2/path = NodePath("Model/Belly/RightWingPivot:translation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@@ -167,7 +169,7 @@ tracks/2/keys = {
"values": [ Vector3( 0.996, 0, 0 ), Vector3( 0.996, 0.085, 0 ), Vector3( 0.996, -0.128, 0 ), Vector3( 0.996, 0, 0 ) ]
}
tracks/3/type = "value"
-tracks/3/path = NodePath("Belly/RightWingPivot:rotation_degrees")
+tracks/3/path = NodePath("Model/Belly/RightWingPivot:rotation_degrees")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@@ -183,7 +185,7 @@ tracks/3/keys = {
resource_name = "hop"
loop = true
tracks/0/type = "value"
-tracks/0/path = NodePath("Belly:translation")
+tracks/0/path = NodePath("Model/Belly:translation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
@@ -200,7 +202,7 @@ resource_name = "idle_bottom"
length = 0.001
loop = true
tracks/0/type = "value"
-tracks/0/path = NodePath("Belly/LeftWingPivot:translation")
+tracks/0/path = NodePath("Model/Belly/LeftWingPivot:translation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
@@ -212,7 +214,7 @@ tracks/0/keys = {
"values": [ Vector3( -0.995677, 0, 0 ) ]
}
tracks/1/type = "value"
-tracks/1/path = NodePath("Belly/LeftWingPivot:rotation_degrees")
+tracks/1/path = NodePath("Model/Belly/LeftWingPivot:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@@ -224,7 +226,7 @@ tracks/1/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/2/type = "value"
-tracks/2/path = NodePath("Belly/RightWingPivot:translation")
+tracks/2/path = NodePath("Model/Belly/RightWingPivot:translation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@@ -236,7 +238,7 @@ tracks/2/keys = {
"values": [ Vector3( 0.996, 0, 0 ) ]
}
tracks/3/type = "value"
-tracks/3/path = NodePath("Belly/RightWingPivot:rotation_degrees")
+tracks/3/path = NodePath("Model/Belly/RightWingPivot:rotation_degrees")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@@ -253,7 +255,7 @@ resource_name = "idle_hop"
length = 0.001
loop = true
tracks/0/type = "value"
-tracks/0/path = NodePath("Belly:translation")
+tracks/0/path = NodePath("Model/Belly:translation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
@@ -270,7 +272,7 @@ resource_name = "idle_top"
length = 0.001
loop = true
tracks/0/type = "value"
-tracks/0/path = NodePath("Belly/HeadPivot:rotation_degrees")
+tracks/0/path = NodePath("Model/Belly/HeadPivot:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
@@ -282,7 +284,7 @@ tracks/0/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/1/type = "value"
-tracks/1/path = NodePath("Belly/HeadPivot/Head/BeakTopPivot:rotation_degrees")
+tracks/1/path = NodePath("Model/Belly/HeadPivot/Head/BeakTopPivot:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@@ -294,7 +296,7 @@ tracks/1/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/2/type = "value"
-tracks/2/path = NodePath("Belly/HeadPivot/Head/BeakBottomPivot:rotation_degrees")
+tracks/2/path = NodePath("Model/Belly/HeadPivot/Head/BeakBottomPivot:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@@ -306,7 +308,7 @@ tracks/2/keys = {
"values": [ Vector3( 0, 0, 0 ) ]
}
tracks/3/type = "value"
-tracks/3/path = NodePath("Belly:rotation_degrees")
+tracks/3/path = NodePath("Model/Belly:rotation_degrees")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@@ -323,7 +325,7 @@ resource_name = "peck"
length = 3.0
loop = true
tracks/0/type = "value"
-tracks/0/path = NodePath("Belly/HeadPivot:rotation_degrees")
+tracks/0/path = NodePath("Model/Belly/HeadPivot:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
@@ -335,7 +337,7 @@ tracks/0/keys = {
"values": [ Vector3( 0, 0, 0 ), Vector3( -18.871, 0, 0 ), Vector3( 3.071, 0, 0 ), Vector3( -18.871, 0, 0 ), Vector3( 3.071, 0, 0 ), Vector3( -18.871, 0, 0 ), Vector3( 0, 0, 0 ) ]
}
tracks/1/type = "value"
-tracks/1/path = NodePath("Belly:rotation_degrees")
+tracks/1/path = NodePath("Model/Belly:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@@ -352,7 +354,7 @@ resource_name = "squack"
length = 2.0
loop = true
tracks/0/type = "value"
-tracks/0/path = NodePath("Belly/HeadPivot:rotation_degrees")
+tracks/0/path = NodePath("Model/Belly/HeadPivot:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
@@ -364,7 +366,7 @@ tracks/0/keys = {
"values": [ Vector3( 0, 0, 0 ), Vector3( 30.215, 0, 0 ), Vector3( 0, 0, 0 ) ]
}
tracks/1/type = "value"
-tracks/1/path = NodePath("Belly/HeadPivot/Head/BeakTopPivot:rotation_degrees")
+tracks/1/path = NodePath("Model/Belly/HeadPivot/Head/BeakTopPivot:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@@ -376,7 +378,7 @@ tracks/1/keys = {
"values": [ Vector3( 0, 0, 0 ), Vector3( 26.24, 0, 0 ), Vector3( 0, 0, 0 ) ]
}
tracks/2/type = "value"
-tracks/2/path = NodePath("Belly/HeadPivot/Head/BeakBottomPivot:rotation_degrees")
+tracks/2/path = NodePath("Model/Belly/HeadPivot/Head/BeakBottomPivot:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@@ -521,60 +523,75 @@ node_connections = [ "output", 0, "Add2", "Add2", 0, "wings", "Add2", 1, "state"
[sub_resource type="AnimationNodeStateMachinePlayback" id=38]
-[sub_resource type="SphereShape" id=67]
+[sub_resource type="CylinderShape" id=72]
+height = 10.0
+
+[sub_resource type="CylinderMesh" id=73]
+height = 10.0
+
+[sub_resource type="SpatialMaterial" id=70]
+flags_transparent = true
+albedo_color = Color( 0.894118, 0.027451, 0.027451, 0.156863 )
[node name="Chicken" type="KinematicBody"]
collision_layer = 4
collision_mask = 5
script = ExtResource( 3 )
-[node name="Belly" type="MeshInstance" parent="."]
+[node name="CollisionShape" type="CollisionShape" parent="."]
+transform = Transform( 1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 0, 0.3, -0.5 )
+shape = SubResource( 71 )
+
+[node name="Model" type="Spatial" parent="."]
+
+[node name="Belly" type="MeshInstance" parent="Model"]
mesh = SubResource( 1 )
+skeleton = NodePath("../..")
material/0 = ExtResource( 1 )
-[node name="HeadPivot" type="Spatial" parent="Belly"]
+[node name="HeadPivot" type="Spatial" parent="Model/Belly"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.657827, -0.749514 )
-[node name="Head" type="MeshInstance" parent="Belly/HeadPivot"]
+[node name="Head" type="MeshInstance" parent="Model/Belly/HeadPivot"]
transform = Transform( 0.6, 0, 0, 0, 0.55438, 0.229484, 0, -0.229484, 0.55438, 0, 0.388057, -0.339644 )
mesh = SubResource( 2 )
-skeleton = NodePath("../../..")
+skeleton = NodePath("../../../..")
material/0 = ExtResource( 1 )
-[node name="BeakTopPivot" type="Spatial" parent="Belly/HeadPivot/Head"]
+[node name="BeakTopPivot" type="Spatial" parent="Model/Belly/HeadPivot/Head"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.19209e-07, -0.965512 )
-[node name="BeakTop" type="MeshInstance" parent="Belly/HeadPivot/Head/BeakTopPivot"]
+[node name="BeakTop" type="MeshInstance" parent="Model/Belly/HeadPivot/Head/BeakTopPivot"]
transform = Transform( 0.3, 0, 0, 0, 0.1, 0, 0, 0, 0.5, 0, 0, -0.452 )
mesh = SubResource( 3 )
skeleton = NodePath("../..")
material/0 = ExtResource( 2 )
-[node name="BeakBottomPivot" type="Spatial" parent="Belly/HeadPivot/Head"]
+[node name="BeakBottomPivot" type="Spatial" parent="Model/Belly/HeadPivot/Head"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.189294, -0.965511 )
-[node name="BeakBottom" type="MeshInstance" parent="Belly/HeadPivot/Head/BeakBottomPivot"]
+[node name="BeakBottom" type="MeshInstance" parent="Model/Belly/HeadPivot/Head/BeakBottomPivot"]
transform = Transform( 0.3, 0, 0, 0, 0.1, 0, 0, 0, 0.5, 0, 0, -0.452 )
mesh = SubResource( 3 )
skeleton = NodePath("../..")
material/0 = ExtResource( 2 )
-[node name="LeftWingPivot" type="Spatial" parent="Belly"]
+[node name="LeftWingPivot" type="Spatial" parent="Model/Belly"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.995677, 0, 0 )
-[node name="LeftWing" type="MeshInstance" parent="Belly/LeftWingPivot"]
+[node name="LeftWing" type="MeshInstance" parent="Model/Belly/LeftWingPivot"]
transform = Transform( 0.5, 0, 0, 0, 0.1, 0, 0, 0, 0.3, -0.377, 0, 0 )
mesh = SubResource( 4 )
-skeleton = NodePath("../../..")
+skeleton = NodePath("../../../..")
material/0 = ExtResource( 1 )
-[node name="RightWingPivot" type="Spatial" parent="Belly"]
+[node name="RightWingPivot" type="Spatial" parent="Model/Belly"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.996, 0, 0 )
-[node name="RightWing" type="MeshInstance" parent="Belly/RightWingPivot"]
+[node name="RightWing" type="MeshInstance" parent="Model/Belly/RightWingPivot"]
transform = Transform( 0.5, 0, 0, 0, 0.1, 0, 0, 0, 0.3, 0.352, 0, 0 )
mesh = SubResource( 4 )
-skeleton = NodePath("../../..")
+skeleton = NodePath("../../../..")
material/0 = ExtResource( 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
@@ -599,11 +616,23 @@ parameters/state/PECK/TimeScale/scale = 2.0
parameters/state/SQUACK/TimeScale/scale = 1.0
parameters/wings/playback = SubResource( 38 )
parameters/wings/FLAP/TimeScale/scale = 2.0
-script = ExtResource( 4 )
-
-[node name="CollisionShape" type="CollisionShape" parent="."]
-transform = Transform( 1, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0.5, -0.5 )
-shape = SubResource( 67 )
[node name="SmoothRotation" type="Tween" parent="."]
script = ExtResource( 5 )
+
+[node name="Detection" type="Area" parent="."]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 0 )
+visible = false
+collision_layer = 0
+collision_mask = 2
+script = ExtResource( 6 )
+
+[node name="CollisionShape" type="CollisionShape" parent="Detection"]
+shape = SubResource( 72 )
+
+[node name="Radar" type="MeshInstance" parent="Detection"]
+mesh = SubResource( 73 )
+material/0 = SubResource( 70 )
+
+[connection signal="body_entered" from="Detection" to="." method="_on_Detection_body_entered"]
+[connection signal="body_exited" from="Detection" to="." method="_on_Detection_body_exited"]