[gd_scene load_steps=17 format=2]

[ext_resource path="res://Player/Player.gd" type="Script" id=1]
[ext_resource path="res://Player/Player.png" type="Texture" id=2]
[ext_resource path="res://Player/StateMachinePlayer.gd" type="Script" id=3]
[ext_resource path="res://Player/Camera2D.gd" type="Script" id=4]





[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 7, 13 )

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 11, 1 )

[sub_resource type="OccluderPolygon2D" id=3]
polygon = PoolVector2Array( -4.18235, -10.4023, 4.22661, -11.0329, 4.43684, 11.5661, -3.55168, 11.461 )

[sub_resource type="Animation" id=4]
tracks/0/type = "value"
tracks/0/path = NodePath("icon:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.6, 1 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 0, 0, 0, 1 ), Color( 1, 1, 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("icon:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 7, 6 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("icon:scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 1, 1 ) ]
}

[sub_resource type="Animation" id=5]
length = 0.5
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath("icon:scale")
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": [ Vector2( 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("icon:frame")
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": [ 10 ]
}

[sub_resource type="Animation" id=6]
length = 0.4
tracks/0/type = "value"
tracks/0/path = NodePath("icon: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 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 2.3, 0 ), Vector2( 0, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("icon:frame")
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": [ 7 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("icon:scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 0.4 ),
"transitions": PoolRealArray( 0.24, 1 ),
"update": 0,
"values": [ Vector2( 0.7, 1.4 ), Vector2( 1, 1 ) ]
}

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

[sub_resource type="Animation" id=8]
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("icon:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0.00961971, 0.420291 ),
"transitions": PoolRealArray( 0.241484, 1 ),
"update": 0,
"values": [ Vector2( 0.4, 1.4 ), Vector2( 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("icon:frame")
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": [ 8 ]
}

[sub_resource type="Animation" id=9]
length = 0.6
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("icon:position")
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": [ Vector2( 0, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("icon:scale")
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( 1, 1 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("icon:frame")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 1, 2, 3, 4, 5, 0 ]
}

[sub_resource type="Animation" id=10]
length = 0.3
tracks/0/type = "value"
tracks/0/path = NodePath("icon: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("icon:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 2.7 ), Vector2( 0, 0 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("icon:scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 1.56917, 0.0457527 ),
"update": 0,
"values": [ Vector2( 1.4, 0.8 ), Vector2( 1, 1 ) ]
}

[sub_resource type="Animation" id=11]
length = 0.5
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("icon: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.3 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ 0, 8, 10 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("icon:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 0.24, 1.51572 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 0, -7.04409 ) ]
}

[sub_resource type="Animation" id=12]
length = 0.4
tracks/0/type = "value"
tracks/0/path = NodePath("icon: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.3 ),
"transitions": PoolRealArray( 0.34151, 1 ),
"update": 0,
"values": [ Vector2( 0, 2.7 ), Vector2( 0, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("icon:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 0.24, 1 ),
"update": 0,
"values": [ Vector2( 1.6, 0.8 ), Vector2( 1, 1 ) ]
}

[node name="Player" type="KinematicBody2D"]
collision_layer = 8
collision_mask = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true,
"_edit_horizontal_guides_": [ 0.0, 0.0, 0.0 ]
}

[node name="AttachPosition" type="Position2D" parent="."]
position = Vector2( 0, 3 )

[node name="Camera2D" type="Camera2D" parent="."]
pause_mode = 2
current = true
zoom = Vector2( 1.6, 1.6 )
limit_left = 0
drag_margin_h_enabled = true
drag_margin_v_enabled = true
smoothing_enabled = true
smoothing_speed = 3.0
editor_draw_drag_margin = true
script = ExtResource( 4 )

[node name="StateMachinePlayer" type="Node" parent="."]
script = ExtResource( 3 )

[node name="PhysicsShape" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )

[node name="Grabbing_shape" type="CollisionShape2D" parent="."]
position = Vector2( 0, -6 )
shape = SubResource( 2 )
disabled = true

[node name="Body" type="Node2D" parent="."]

[node name="icon" type="Sprite" parent="Body"]
texture = ExtResource( 2 )
vframes = 2
hframes = 6

[node name="LightOccluder2D" type="LightOccluder2D" parent="Body/icon"]
occluder = SubResource( 3 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="Body"]
anims/dead = SubResource( 4 )
anims/fall = SubResource( 5 )
anims/grab = SubResource( 6 )
anims/idle = SubResource( 7 )
anims/jump = SubResource( 8 )
anims/move = SubResource( 9 )
anims/squash = SubResource( 10 )
anims/victory = SubResource( 11 )

[node name="Effect_Player" type="AnimationPlayer" parent="Body"]
anims/land = SubResource( 12 )

[node name="WallGrabRaycast" type="Node2D" parent="."]

[node name="Right" type="Node2D" parent="WallGrabRaycast"]

[node name="RightWall" type="RayCast2D" parent="WallGrabRaycast/Right"]
position = Vector2( 7, -12 )
rotation = -1.5708
enabled = true
cast_to = Vector2( 0, 3 )
collision_mask = 2

[node name="RightWall2" type="RayCast2D" parent="WallGrabRaycast/Right"]
position = Vector2( 7, 0 )
rotation = -1.5708
enabled = true
exclude_parent = false
cast_to = Vector2( 0, 3 )
collision_mask = 2

[node name="RightWall3" type="RayCast2D" parent="WallGrabRaycast/Right"]
position = Vector2( 7, 6 )
rotation = -1.5708
exclude_parent = false
cast_to = Vector2( 0, 3 )
collision_mask = 2

[node name="Left" type="Node2D" parent="WallGrabRaycast"]

[node name="LeftWall" type="RayCast2D" parent="WallGrabRaycast/Left"]
position = Vector2( -7, -12 )
rotation = 1.5708
enabled = true
cast_to = Vector2( 0, 3 )
collision_mask = 2

[node name="LeftWall2" type="RayCast2D" parent="WallGrabRaycast/Left"]
position = Vector2( -7, 0 )
rotation = 1.5708
enabled = true
cast_to = Vector2( 0, 3 )
collision_mask = 2

[node name="LeftWall3" type="RayCast2D" parent="WallGrabRaycast/Left"]
position = Vector2( -7, 6 )
rotation = 1.5708
cast_to = Vector2( 0, 3 )
collision_mask = 2

[node name="WallslideCooldown" type="Timer" parent="."]
wait_time = 0.2
one_shot = true

[node name="WallslideStick" type="Timer" parent="."]
wait_time = 0.2
one_shot = true

[node name="CoyoteTimer" type="Timer" parent="."]
wait_time = 0.1
one_shot = true
[connection signal="killed" from="." to="StateMachinePlayer" method="_on_Player_killed"]
[connection signal="victory" from="." to="Camera2D" method="_on_Player_victory"]
[connection signal="victory" from="." to="StateMachinePlayer" method="_on_Player_victory"]
[connection signal="timeout" from="WallslideStick" to="StateMachinePlayer" method="_on_WallslideStick_timeout"]
