[gd_scene load_steps=7 format=2]

[ext_resource path="res://src/Platforms/FlyingPlatform.gd" type="Script" id=1]
[ext_resource path="res://assets/contraption/3xFloatingPlatform.png" type="Texture" id=2]
[ext_resource path="res://assets/sounds/AMBIENCE_SciFi_Static_Tonal_loop_stereo.wav" type="AudioStream" id=3]

[sub_resource type="Animation" id=1]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath(".: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": 0,
"values": [ 0 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:frame_coords")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ) ]
}

[sub_resource type="Animation" id=2]
resource_name = "v1"
length = 1.1
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".: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, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
}

[sub_resource type="Animation" id=3]
resource_name = "v2"
length = 0.5
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".: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, 0.3, 0.4 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 11, 12, 13, 14, 15 ]
}

[node name="FlyingPlatformSmol" type="Node2D"]
script = ExtResource( 1 )

[node name="PlatformBody" type="KinematicBody2D" parent="."]
collision_layer = 16
collision_mask = 3
motion/sync_to_physics = true
moving_platform_apply_velocity_on_leave = 2

[node name="Sprite" type="Sprite" parent="PlatformBody"]
position = Vector2( 0, 8 )
texture = ExtResource( 2 )
hframes = 17

[node name="AnimationPlayer" type="AnimationPlayer" parent="PlatformBody/Sprite"]
autoplay = "v1"
anims/RESET = SubResource( 1 )
anims/v1 = SubResource( 2 )
anims/v2 = SubResource( 3 )

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PlatformBody"]
position = Vector2( 0, 4 )
scale = Vector2( 4, 0.4 )
polygon = PoolVector2Array( -6, -10, 6, -10, 5.5, 0, 5.25, 5, -5.25, 5, -5.5, 0 )

[node name="FlyTween" type="Tween" parent="."]

[node name="FlyingSound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 3 )
volume_db = -12.0
autoplay = true
max_distance = 480.0
attenuation = 3.73213
bus = "Effects"

[connection signal="tween_completed" from="FlyTween" to="." method="_on_FlyTween_tween_completed"]
