[gd_scene load_steps=35 format=3 uid="uid://bt1p311rn1h6q"]

[ext_resource type="Script" path="res://vehicules/car.gd" id="1_vkq5y"]
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="3_iaqxo"]
[ext_resource type="Texture2D" uid="uid://dq81e78eaild8" path="res://assest/vehicules/Car_classic_red_48x48.png" id="4_0kman"]

[sub_resource type="Animation" id="Animation_24r8n"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}

[sub_resource type="Animation" id="Animation_ny3my"]
resource_name = "driving_down"
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [18, 19, 20, 21, 22, 23]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}

[sub_resource type="Animation" id="Animation_o7myv"]
resource_name = "driving_left"
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [12, 13, 14, 15, 16, 17]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="Animation" id="Animation_jej8v"]
resource_name = "driving_right"
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="Animation" id="Animation_ns0lb"]
resource_name = "driving_up"
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [6, 7, 8, 9, 10, 11]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}

[sub_resource type="Animation" id="Animation_uyd0m"]
resource_name = "idling_down"
length = 0.1
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [47]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}

[sub_resource type="Animation" id="Animation_k8xkk"]
resource_name = "idling_left"
length = 0.1
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [46]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="Animation" id="Animation_vk5cn"]
resource_name = "idling_right"
length = 0.1
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [34]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="Animation" id="Animation_xch04"]
resource_name = "idling_up"
length = 0.1
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [35]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}

[sub_resource type="Animation" id="Animation_0uy2s"]
resource_name = "opening_door_left"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [36, 37, 38, 39, 40, 41, 42, 43, 44, 45]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="Animation" id="Animation_goslp"]
resource_name = "opening_door_right"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Car/Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [24, 25, 26, 27, 28, 29, 30, 31, 32, 33]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Car/CollisionHorizontal:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Car/CollisionVertical:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_10pc8"]
_data = {
"RESET": SubResource("Animation_24r8n"),
"driving_down": SubResource("Animation_ny3my"),
"driving_left": SubResource("Animation_o7myv"),
"driving_right": SubResource("Animation_jej8v"),
"driving_up": SubResource("Animation_ns0lb"),
"idling_down": SubResource("Animation_uyd0m"),
"idling_left": SubResource("Animation_k8xkk"),
"idling_right": SubResource("Animation_vk5cn"),
"idling_up": SubResource("Animation_xch04"),
"opening_door_left": SubResource("Animation_0uy2s"),
"opening_door_right": SubResource("Animation_goslp")
}

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_btgy7"]
animation = &"driving_left"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_d53q5"]
animation = &"driving_right"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_22qxt"]
animation = &"driving_up"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_o21fb"]
animation = &"driving_down"

[sub_resource type="AnimationNodeBlendSpace2D" id="AnimationNodeBlendSpace2D_6rjtg"]
blend_point_0/node = SubResource("AnimationNodeAnimation_btgy7")
blend_point_0/pos = Vector2(-1, 0)
blend_point_1/node = SubResource("AnimationNodeAnimation_d53q5")
blend_point_1/pos = Vector2(1, 0)
blend_point_2/node = SubResource("AnimationNodeAnimation_22qxt")
blend_point_2/pos = Vector2(0, -1)
blend_point_3/node = SubResource("AnimationNodeAnimation_o21fb")
blend_point_3/pos = Vector2(0, 1)
blend_mode = 2

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_3fbcc"]
animation = &"idling_left"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_11mhe"]
animation = &"idling_right"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6x8m6"]
animation = &"idling_down"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ogtbq"]
animation = &"idling_up"

[sub_resource type="AnimationNodeBlendSpace2D" id="AnimationNodeBlendSpace2D_csi6s"]
blend_point_0/node = SubResource("AnimationNodeAnimation_3fbcc")
blend_point_0/pos = Vector2(-1, 0)
blend_point_1/node = SubResource("AnimationNodeAnimation_11mhe")
blend_point_1/pos = Vector2(1, 0)
blend_point_2/node = SubResource("AnimationNodeAnimation_6x8m6")
blend_point_2/pos = Vector2(0, 1)
blend_point_3/node = SubResource("AnimationNodeAnimation_ogtbq")
blend_point_3/pos = Vector2(0, -1)
blend_mode = 2

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4uk5k"]
advance_mode = 2
advance_expression = "velocity"

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_3q86p"]
advance_mode = 2
advance_expression = "!velocity"

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_0fk7h"]
advance_mode = 2
advance_expression = "!velocity"

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6jgtk"]
advance_mode = 2
advance_expression = "velocity"

[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_tnex5"]
states/Start/position = Vector2(192, 89.5556)
states/driving/node = SubResource("AnimationNodeBlendSpace2D_6rjtg")
states/driving/position = Vector2(460.667, -34.6667)
states/idling/node = SubResource("AnimationNodeBlendSpace2D_csi6s")
states/idling/position = Vector2(459.111, 88.6667)
transitions = ["Start", "driving", SubResource("AnimationNodeStateMachineTransition_4uk5k"), "Start", "idling", SubResource("AnimationNodeStateMachineTransition_3q86p"), "driving", "idling", SubResource("AnimationNodeStateMachineTransition_0fk7h"), "idling", "driving", SubResource("AnimationNodeStateMachineTransition_6jgtk")]
graph_offset = Vector2(80, -182)

[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_5fwej"]

[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_q5j17"]
graph_offset = Vector2(-221.333, -11.3333)
nodes/CarStates/node = SubResource("AnimationNodeStateMachine_tnex5")
nodes/CarStates/position = Vector2(-133.333, 173.333)
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_5fwej")
nodes/TimeScale/position = Vector2(120, 120)
node_connections = [&"TimeScale", 0, &"CarStates", &"output", 0, &"TimeScale"]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_l8rwt"]
radius = 31.0
height = 186.0

[sub_resource type="RectangleShape2D" id="RectangleShape2D_yiphh"]
size = Vector2(200, 15)

[node name="Car" type="CharacterBody2D" node_paths=PackedStringArray("debugLabel")]
collision_mask = 3
motion_mode = 1
script = ExtResource("1_vkq5y")
debugLabel = NodePath("Label")

[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("4_0kman")
hframes = 12
vframes = 4
frame = 46

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
root_node = NodePath("../..")
libraries = {
"": SubResource("AnimationLibrary_10pc8")
}

[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath("../..")
tree_root = SubResource("AnimationNodeBlendTree_q5j17")
advance_expression_base_node = NodePath("..")
anim_player = NodePath("../AnimationPlayer")
parameters/CarStates/driving/blend_position = Vector2(0.0425786, -0.23119)
parameters/CarStates/idling/blend_position = Vector2(-0.31635, 0.279753)
parameters/TimeScale/scale = 1.0

[node name="CollisionHorizontal" type="CollisionShape2D" parent="."]
position = Vector2(-4, 28)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_l8rwt")

[node name="CollisionVertical" type="CollisionShape2D" parent="."]
position = Vector2(1, 2)
rotation = -3.14159
shape = SubResource("CapsuleShape2D_l8rwt")
disabled = true

[node name="Label" type="Label" parent="."]
offset_left = 72.0
offset_top = -42.0
offset_right = 112.0
offset_bottom = -19.0

[node name="ZIndexControler" parent="." instance=ExtResource("3_iaqxo")]

[node name="ShapeCast2D" type="ShapeCast2D" parent="ZIndexControler"]
position = Vector2(1, -13)
shape = SubResource("RectangleShape2D_yiphh")
target_position = Vector2(1, -32)
