115 lines
3.3 KiB
Text
115 lines
3.3 KiB
Text
|
[gd_scene load_steps=6 format=2]
|
||
|
|
||
|
[ext_resource path="res://objects/falling_log/assets/log.svg" type="Texture" id=1]
|
||
|
[ext_resource path="res://objects/falling_log/falling_log.gd" type="Script" id=2]
|
||
|
|
||
|
[sub_resource type="RectangleShape2D" id=1]
|
||
|
extents = Vector2( 34.5, 20 )
|
||
|
|
||
|
[sub_resource type="Animation" id=2]
|
||
|
resource_name = "player_on_log"
|
||
|
length = 3.0
|
||
|
tracks/0/type = "value"
|
||
|
tracks/0/path = NodePath("Sprite:position")
|
||
|
tracks/0/interp = 1
|
||
|
tracks/0/loop_wrap = true
|
||
|
tracks/0/imported = false
|
||
|
tracks/0/enabled = true
|
||
|
tracks/0/keys = {
|
||
|
"times": PoolRealArray( 0, 0.2, 0.5, 3 ),
|
||
|
"transitions": PoolRealArray( -2, 0.5, 6, 1 ),
|
||
|
"update": 0,
|
||
|
"values": [ Vector2( 0, 20 ), Vector2( 0, 40 ), Vector2( 0, 25 ), Vector2( 0, 1000 ) ]
|
||
|
}
|
||
|
tracks/1/type = "value"
|
||
|
tracks/1/path = NodePath("Sprite:modulate")
|
||
|
tracks/1/interp = 1
|
||
|
tracks/1/loop_wrap = true
|
||
|
tracks/1/imported = false
|
||
|
tracks/1/enabled = true
|
||
|
tracks/1/keys = {
|
||
|
"times": PoolRealArray( 0, 0.5, 2.5 ),
|
||
|
"transitions": PoolRealArray( 1, 6, 2 ),
|
||
|
"update": 0,
|
||
|
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||
|
}
|
||
|
tracks/2/type = "value"
|
||
|
tracks/2/path = NodePath("Collision:position")
|
||
|
tracks/2/interp = 1
|
||
|
tracks/2/loop_wrap = true
|
||
|
tracks/2/imported = false
|
||
|
tracks/2/enabled = true
|
||
|
tracks/2/keys = {
|
||
|
"times": PoolRealArray( 0, 0.2, 0.5, 3 ),
|
||
|
"transitions": PoolRealArray( 1, -2, 6, 1 ),
|
||
|
"update": 0,
|
||
|
"values": [ Vector2( 0, 20 ), Vector2( 0, 40 ), Vector2( 0, 25 ), Vector2( 0, 1000 ) ]
|
||
|
}
|
||
|
|
||
|
[sub_resource type="Animation" id=3]
|
||
|
resource_name = "recover"
|
||
|
tracks/0/type = "value"
|
||
|
tracks/0/path = NodePath("Sprite:position")
|
||
|
tracks/0/interp = 1
|
||
|
tracks/0/loop_wrap = true
|
||
|
tracks/0/imported = false
|
||
|
tracks/0/enabled = true
|
||
|
tracks/0/keys = {
|
||
|
"times": PoolRealArray( 0, 1 ),
|
||
|
"transitions": PoolRealArray( -2, 1 ),
|
||
|
"update": 0,
|
||
|
"values": [ Vector2( 0, 50 ), Vector2( 0, 20 ) ]
|
||
|
}
|
||
|
tracks/1/type = "value"
|
||
|
tracks/1/path = NodePath("Collision:position")
|
||
|
tracks/1/interp = 1
|
||
|
tracks/1/loop_wrap = true
|
||
|
tracks/1/imported = false
|
||
|
tracks/1/enabled = true
|
||
|
tracks/1/keys = {
|
||
|
"times": PoolRealArray( 0.001, 1 ),
|
||
|
"transitions": PoolRealArray( -2, 1 ),
|
||
|
"update": 0,
|
||
|
"values": [ Vector2( 0, 50 ), Vector2( 0, 20 ) ]
|
||
|
}
|
||
|
tracks/2/type = "value"
|
||
|
tracks/2/path = NodePath("Sprite:modulate")
|
||
|
tracks/2/interp = 1
|
||
|
tracks/2/loop_wrap = true
|
||
|
tracks/2/imported = false
|
||
|
tracks/2/enabled = true
|
||
|
tracks/2/keys = {
|
||
|
"times": PoolRealArray( 0, 1 ),
|
||
|
"transitions": PoolRealArray( 1, 1 ),
|
||
|
"update": 0,
|
||
|
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||
|
}
|
||
|
|
||
|
[node name="FallingLog" type="StaticBody2D"]
|
||
|
collision_layer = 4
|
||
|
collision_mask = 0
|
||
|
script = ExtResource( 2 )
|
||
|
|
||
|
[node name="Sprite" type="Sprite" parent="."]
|
||
|
position = Vector2( 0, 20 )
|
||
|
texture = ExtResource( 1 )
|
||
|
|
||
|
[node name="Collision" type="CollisionShape2D" parent="."]
|
||
|
position = Vector2( 0, 20 )
|
||
|
shape = SubResource( 1 )
|
||
|
|
||
|
[node name="PlayerCollision" type="Area2D" parent="."]
|
||
|
collision_layer = 0
|
||
|
|
||
|
[node name="Collision" type="CollisionShape2D" parent="PlayerCollision"]
|
||
|
position = Vector2( 0, 20 )
|
||
|
scale = Vector2( 1.2, 1.2 )
|
||
|
shape = SubResource( 1 )
|
||
|
|
||
|
[node name="Animation" type="AnimationPlayer" parent="."]
|
||
|
anims/player_on_log = SubResource( 2 )
|
||
|
anims/recover = SubResource( 3 )
|
||
|
|
||
|
[connection signal="body_entered" from="PlayerCollision" to="." method="_on_PlayerCollision"]
|
||
|
[connection signal="animation_finished" from="Animation" to="." method="_on_Animation_finished"]
|