diff --git a/animations/human/human_blend_tree.tres b/animations/human/human_blend_tree.tres new file mode 100644 index 0000000..a7f35b0 --- /dev/null +++ b/animations/human/human_blend_tree.tres @@ -0,0 +1,13 @@ +[gd_resource type="AnimationNodeBlendTree" load_steps=3 format=3 uid="uid://b3bttga61e3go"] + +[ext_resource type="AnimationNodeStateMachine" uid="uid://ddr1ltkievtku" path="res://animations/human/human_state_machine.tres" id="1_1tkpt"] + +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_85jde"] + +[resource] +nodes/HumanState/node = ExtResource("1_1tkpt") +nodes/HumanState/position = Vector2(133.333, 120) +nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_85jde") +nodes/TimeScale/position = Vector2(453.333, 53.3333) +nodes/output/position = Vector2(640, 146.667) +node_connections = [&"TimeScale", 0, &"HumanState", &"output", 0, &"TimeScale"] diff --git a/animations/human/human_state_machine.tres b/animations/human/human_state_machine.tres index fadde50..7d3c0df 100644 --- a/animations/human/human_state_machine.tres +++ b/animations/human/human_state_machine.tres @@ -1,6 +1,6 @@ [gd_resource type="AnimationNodeStateMachine" load_steps=19 format=3 uid="uid://ddr1ltkievtku"] -[ext_resource type="AnimationNodeBlendSpace2D" uid="uid://cy73mgvdr54rh" path="res://animations/human/human_walking_blend.tres" id="1_svxl8"] +[ext_resource type="AnimationNodeBlendSpace2D" uid="uid://cy73mgvdr54rh" path="res://animations/human/human_walking_blend.tres" id="1_wk1fq"] [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8th2p"] animation = &"grabbing_left" @@ -77,12 +77,13 @@ switch_mode = 2 advance_mode = 2 [resource] +states/End/position = Vector2(946, 81.8025) states/Start/position = Vector2(161.333, 82) states/grabing/node = SubResource("AnimationNodeBlendSpace2D_8okss") states/grabing/position = Vector2(629, 81.037) states/idling/node = SubResource("AnimationNodeBlendSpace2D_epue7") states/idling/position = Vector2(383.148, 81.5555) -states/walking/node = ExtResource("1_svxl8") +states/walking/node = ExtResource("1_wk1fq") states/walking/position = Vector2(382.556, -106.667) transitions = ["Start", "walking", SubResource("AnimationNodeStateMachineTransition_qfvli"), "walking", "idling", SubResource("AnimationNodeStateMachineTransition_8rhh4"), "idling", "walking", SubResource("AnimationNodeStateMachineTransition_b5dux"), "Start", "idling", SubResource("AnimationNodeStateMachineTransition_8q1xr"), "idling", "grabing", SubResource("AnimationNodeStateMachineTransition_on1es"), "walking", "grabing", SubResource("AnimationNodeStateMachineTransition_pxk2l"), "grabing", "idling", SubResource("AnimationNodeStateMachineTransition_t6jft")] -graph_offset = Vector2(-18, -138) +graph_offset = Vector2(-54, -204) diff --git a/assest/vehicules/Car_classic_red_48x48.png b/assest/vehicules/Car_classic_red_48x48.png new file mode 100644 index 0000000..778eedf Binary files /dev/null and b/assest/vehicules/Car_classic_red_48x48.png differ diff --git a/assest/vehicules/Car_classic_red_48x48.png.import b/assest/vehicules/Car_classic_red_48x48.png.import new file mode 100644 index 0000000..ecf8273 --- /dev/null +++ b/assest/vehicules/Car_classic_red_48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dq81e78eaild8" +path="res://.godot/imported/Car_classic_red_48x48.png-6562938659f1241e69dbbb04a65b66b1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assest/vehicules/Car_classic_red_48x48.png" +dest_files=["res://.godot/imported/Car_classic_red_48x48.png-6562938659f1241e69dbbb04a65b66b1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/caracters/player/player.tscn b/caracters/player/player.tscn index 5520eb8..88d6f4f 100644 --- a/caracters/player/player.tscn +++ b/caracters/player/player.tscn @@ -12,6 +12,7 @@ height = 48.0 [sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_85jde"] [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_iwsa7"] +graph_offset = Vector2(0, -54) nodes/HumanState/node = ExtResource("3_1y7fn") nodes/HumanState/position = Vector2(133.333, 120) nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_85jde") diff --git a/scenes/pathFollow.gd b/scenes/pathFollow.gd index 6989d03..4960fb0 100644 --- a/scenes/pathFollow.gd +++ b/scenes/pathFollow.gd @@ -1,13 +1,13 @@ +class_name NPCCar extends PathFollow2D +@export var car : Car @export var speed = 0.1 -var voiture -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - voiture = (self.get_child(0) as Voiture) - voiture.updatePosition(position.x, position.y) +@export var distanceMax = 100 + # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: - progress_ratio += delta * speed; - voiture.updatePosition(position.x, position.y) + if position.distance_to(car.position) < 200: + progress_ratio += delta * speed; + car.moveTo(position); diff --git a/scenes/sta3CFA.tmp b/scenes/sta3CFA.tmp new file mode 100644 index 0000000..5ca30b6 --- /dev/null +++ b/scenes/sta3CFA.tmp @@ -0,0 +1,51 @@ +[gd_scene load_steps=7 format=3 uid="uid://b4ydi1vv8dvwr"] + +[ext_resource type="PackedScene" uid="uid://d1oqt6sbjvopi" path="res://maps/world.tscn" id="1_6vs81"] +[ext_resource type="PackedScene" uid="uid://vclpg4e4ql54" path="res://caracters/player/player.tscn" id="2_5x6b5"] +[ext_resource type="PackedScene" uid="uid://cl201baro5y5" path="res://vehicules/npc_car.tscn" id="3_yuakw"] +[ext_resource type="PackedScene" uid="uid://bt1p311rn1h6q" path="res://vehicules/car.tscn" id="4_bqm78"] + +[sub_resource type="Curve2D" id="Curve2D_shblg"] +_data = { +"points": PackedVector2Array(0, 0, 0, 0, -285, 193, -110.06, 94.1858, 110.06, -94.1858, 52, 134, -159.798, 75.137, 159.798, -75.137, 204, 13, -116.409, -28.5732, 116.409, 28.5732, 2206, -11, -93.6567, -28.0441, 93.6567, 28.0441, 2387, 165, -119.584, 76.7244, 119.584, -76.7244, 2750, 126, 108.472, 48.6803, -108.472, -48.6803, 2737, -309, 122.23, -57.1464, -122.23, 57.1464, 2340, -323, 76.1953, -36.5102, -76.1953, 36.5102, 2167, -129, 107.414, 77.2535, -107.414, -77.2535, 158, -148, 57.4153, 72.8272, -57.4153, -72.8272, 39, -293, 113.137, -95.6951, -113.137, 95.6951, -405, -291, -94.7149, -70.9039, 94.7149, 70.9039, -413, 128, 0, 0, 0, 0, -286, 193, 0, 0, 0, 0, -285, 193) +} +point_count = 15 + +[sub_resource type="Curve2D" id="Curve2D_nircx"] +_data = { +"points": PackedVector2Array(0, 0, 0, 0, 803, 1569, 0, 0, 0, 0, 910, 1573, 0, 0, 0, 0, 913, 1368, 0, 0, 0, 0, 1926, 1371, 0, 0, 0, 0, 1931, 342, 0, 0, 0, 0, 2082, 333, 0, 0, 0, 0, 2060, -140, 0, 0, 0, 0, 1718, -143, 0, 0, 0, 0, 1724, 20, 0, 0, 0, 0, 900, 30, 0, 0, 0, 0, 904, -1165, 0, 0, 0, 0, -890, -1162, 0, 0, 0, 0, -886, -119, 0, 0, 0, 0, -1062, -106, 0, 0, 0, 0, -1076, 268, 0, 0, 0, 0, -630, 271, 0, 0, 0, 0, -616, 161, 0, 0, 0, 0, 786, 152, 0, 0, 0, 0, 806, 1560) +} +point_count = 19 + +[node name="scene1" type="Node2D"] + +[node name="monde" parent="." instance=ExtResource("1_6vs81")] + +[node name="movibles" type="Node2D" parent="."] + +[node name="Area2D" parent="movibles" instance=ExtResource("2_5x6b5")] +position = Vector2(87, 74) + +[node name="voitures" type="Node" parent="movibles"] + +[node name="Path2D" type="Path2D" parent="movibles/voitures"] +position = Vector2(-664, 181) +curve = SubResource("Curve2D_shblg") + +[node name="voiture_pnj" parent="movibles/voitures/Path2D" node_paths=PackedStringArray("car") instance=ExtResource("3_yuakw")] +position = Vector2(-285, 193) +car = NodePath("../Car") + +[node name="Car" parent="movibles/voitures/Path2D" instance=ExtResource("4_bqm78")] +position = Vector2(-287, 196) + +[node name="Path2D2" type="Path2D" parent="movibles/voitures"] +curve = SubResource("Curve2D_nircx") + +[node name="voiture_pnj" parent="movibles/voitures/Path2D2" node_paths=PackedStringArray("car") instance=ExtResource("3_yuakw")] +position = Vector2(803, 1569) +car = NodePath("../Car2") +speed = 0.05 + +[node name="Car2" parent="movibles/voitures/Path2D2" instance=ExtResource("4_bqm78")] +position = Vector2(796, 1559) diff --git a/scenes/start.tscn b/scenes/start.tscn index 560882b..811c81e 100644 --- a/scenes/start.tscn +++ b/scenes/start.tscn @@ -1,20 +1,21 @@ -[gd_scene load_steps=6 format=3 uid="uid://b4ydi1vv8dvwr"] +[gd_scene load_steps=7 format=3 uid="uid://b4ydi1vv8dvwr"] [ext_resource type="PackedScene" uid="uid://d1oqt6sbjvopi" path="res://maps/world.tscn" id="1_6vs81"] [ext_resource type="PackedScene" uid="uid://vclpg4e4ql54" path="res://caracters/player/player.tscn" id="2_5x6b5"] [ext_resource type="PackedScene" uid="uid://cl201baro5y5" path="res://vehicules/npc_car.tscn" id="3_yuakw"] +[ext_resource type="PackedScene" uid="uid://bt1p311rn1h6q" path="res://vehicules/car.tscn" id="4_bqm78"] [sub_resource type="Curve2D" id="Curve2D_shblg"] _data = { -"points": PackedVector2Array(0, 0, 0, 0, -411, 81, 0, 0, 0, 0, 37, 81, 0, 0, 0, 0, 37, -34, 0, 0, 0, 0, 2392, -33, 0, 0, 0, 0, 2395, 125, 0, 0, 0, 0, 2750, 126, 0, 0, 0, 0, 2750, -313, 0, 0, 0, 0, 2391, -314, 0, 0, 0, 0, 2390, -149, 0, 0, 0, 0, 39, -144, 0, 0, 0, 0, 39, -293, 0, 0, 0, 0, -398, -289, 0, 0, 0, 0, -409, -310, 0, 0, 0, 0, -414, 78) +"points": PackedVector2Array(0, 0, 0, 0, -285, 193, -110.06, 94.1858, 110.06, -94.1858, 52, 134, -159.798, 75.137, 159.798, -75.137, 204, 13, -116.409, -28.5732, 116.409, 28.5732, 2206, -11, -93.6567, -28.0441, 93.6567, 28.0441, 2387, 165, -119.584, 76.7244, 119.584, -76.7244, 2750, 126, 108.472, 48.6803, -108.472, -48.6803, 2737, -309, 122.23, -57.1464, -122.23, 57.1464, 2340, -323, 76.1953, -36.5102, -76.1953, 36.5102, 2167, -129, 107.414, 77.2535, -107.414, -77.2535, 158, -148, 57.4153, 72.8272, -57.4153, -72.8272, 39, -293, 113.137, -95.6951, -113.137, 95.6951, -405, -291, -94.7149, -70.9039, 94.7149, 70.9039, -413, 128, 0, 0, 0, 0, -286, 193, 0, 0, 0, 0, -285, 193) } -point_count = 14 +point_count = 15 [sub_resource type="Curve2D" id="Curve2D_nircx"] _data = { -"points": PackedVector2Array(0, 0, 0, 0, 803, 1569, 0, 0, 0, 0, 910, 1573, 0, 0, 0, 0, 913, 1368, 0, 0, 0, 0, 1926, 1371, 0, 0, 0, 0, 1931, 342, 0, 0, 0, 0, 2082, 333, 0, 0, 0, 0, 2060, -140, 0, 0, 0, 0, 1718, -143, 0, 0, 0, 0, 1724, 20, 0, 0, 0, 0, 900, 30, 0, 0, 0, 0, 904, -1165, 0, 0, 0, 0, -890, -1162, 0, 0, 0, 0, -886, -119, 0, 0, 0, 0, -1062, -106, 0, 0, 0, 0, -1079, 264, 0, 0, 0, 0, -630, 271, 0, 0, 0, 0, -616, 161, 0, 0, 0, 0, 786, 152, 0, 0, 0, 0, 806, 1560) +"points": PackedVector2Array(0, 0, 0, 0, 803, 1569, 0, 0, 0, 0, 910, 1573, 0, 0, 0, 0, 913, 1368, 0, 0, 0, 0, 1926, 1371, 0, 0, 0, 0, 1931, 342, 0, 0, 0, 0, 2082, 333, 0, 0, 0, 0, 2060, -140, 0, 0, 0, 0, 1718, -143, 0, 0, 0, 0, 1649, 73, 0, 0, 0, 0, 814, 68, 0, 0, 0, 0, 897, -123, 0, 0, 0, 0, 904, -1165, 0, 0, 0, 0, -890, -1162, 0, 0, 0, 0, -886, -119, 0, 0, 0, 0, -1062, -106, 0, 0, 0, 0, -1076, 268, 0, 0, 0, 0, -630, 271, 0, 0, 0, 0, -616, 161, 0, 0, 0, 0, 858, 167, 0, 0, 0, 0, 806, 1560) } -point_count = 19 +point_count = 20 [node name="scene1" type="Node2D"] @@ -31,11 +32,24 @@ position = Vector2(87, 74) position = Vector2(-664, 181) curve = SubResource("Curve2D_shblg") -[node name="voiture_pnj" parent="movibles/voitures/Path2D" instance=ExtResource("3_yuakw")] +[node name="voiture_pnj" parent="movibles/voitures/Path2D" node_paths=PackedStringArray("car") instance=ExtResource("3_yuakw")] +position = Vector2(-285, 193) +car = NodePath("../Car") +speed = 0.2 +distanceMax = 200 + +[node name="Car" parent="movibles/voitures/Path2D" instance=ExtResource("4_bqm78")] +position = Vector2(-287, 196) +speed = 500 [node name="Path2D2" type="Path2D" parent="movibles/voitures"] curve = SubResource("Curve2D_nircx") -[node name="voiture_pnj" parent="movibles/voitures/Path2D2" instance=ExtResource("3_yuakw")] +[node name="voiture_pnj" parent="movibles/voitures/Path2D2" node_paths=PackedStringArray("car") instance=ExtResource("3_yuakw")] position = Vector2(803, 1569) -speed = 0.05 +car = NodePath("../Car") +distanceMax = 15 + +[node name="Car" parent="movibles/voitures/Path2D2" instance=ExtResource("4_bqm78")] +position = Vector2(803, 1558) +speed = 500 diff --git a/vehicules/car.gd b/vehicules/car.gd index b926335..508ee28 100644 --- a/vehicules/car.gd +++ b/vehicules/car.gd @@ -1,33 +1,27 @@ -class_name Voiture -extends Area2D +class_name Car +extends CharacterBody2D -var prevPositionX = 0; -var prevPositionY = 0; +@export var speed = 750 # How fast the car will move (pixels/sec). +@onready var animation_tree := $AnimationTree +@onready var state_machine := animation_tree.get("parameters/driving/playback") as AnimationNodeStateMachinePlayback + +var last_facing_direction = Vector2(0,-1) # facing north + +var targetPosition = null + +func moveTo(position: Vector2) -> void: + targetPosition = position; + +func updateFacingDirectionInAnimationTree(): + animation_tree.set("parameters/CarStates/driving/blend_position", last_facing_direction) + animation_tree.set("parameters/CarStates/idling/blend_position", last_facing_direction) -func updatePosition(x: float, y: float) -> void: - var velocityX = prevPositionX - x; - var velocityY = prevPositionY - y; - $shapeDown.set_deferred("disabled", true); - $shapeUp.set_deferred("disabled", true); - $shapeLeft.set_deferred("disabled", true); - $shapeRight.set_deferred("disabled", true); - if(abs(velocityX) > abs(velocityY)): - if velocityX > 0 : - $AnimatedSprite2D.animation = "driving_left"; - $shapeLeft.set_deferred("disabled", false); - if velocityX < 0 : - $AnimatedSprite2D.animation = "driving_right"; - $shapeRight.set_deferred("disabled", false); - if(abs(velocityX) < abs(velocityY)): - if velocityY > 0 : - $AnimatedSprite2D.animation = "driving_up"; - $shapeUp.set_deferred("disabled", false); - if velocityY < 0 : - $AnimatedSprite2D.animation = "driving_down"; - $shapeDown.set_deferred("disabled", false); - prevPositionX = x; - prevPositionY = y; - # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: - $AnimatedSprite2D.play() + if (targetPosition != null): + velocity = (targetPosition - position) * speed * delta; + move_and_slide() + if velocity: + last_facing_direction = velocity.normalized() + + updateFacingDirectionInAnimationTree() diff --git a/vehicules/car.tscn b/vehicules/car.tscn index 23abd39..b66ee8d 100644 --- a/vehicules/car.tscn +++ b/vehicules/car.tscn @@ -1,241 +1,583 @@ [gd_scene load_steps=33 format=3 uid="uid://bt1p311rn1h6q"] [ext_resource type="Script" path="res://vehicules/car.gd" id="1_vkq5y"] -[ext_resource type="Texture2D" uid="uid://55dsls4caujg" path="res://assest/vehicules/Car_classic_red_complete_48x48.png" id="2_ahai6"] -[ext_resource type="Texture2D" uid="uid://c5dis1wikcqws" path="res://assest/vehicules/Car_classic_red_complete_48x48_left.png" id="3_tnfoa"] +[ext_resource type="Texture2D" uid="uid://dq81e78eaild8" path="res://assest/vehicules/Car_classic_red_48x48.png" id="4_0kman"] -[sub_resource type="AtlasTexture" id="AtlasTexture_8fi8c"] -atlas = ExtResource("2_ahai6") -region = Rect2(3408, 222, 96, 210) +[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="AtlasTexture" id="AtlasTexture_tgw3a"] -atlas = ExtResource("2_ahai6") -region = Rect2(3504, 222, 96, 210) +[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="AtlasTexture" id="AtlasTexture_dj0xl"] -atlas = ExtResource("2_ahai6") -region = Rect2(3600, 222, 96, 210) +[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="AtlasTexture" id="AtlasTexture_omrb2"] -atlas = ExtResource("2_ahai6") -region = Rect2(3696, 222, 96, 210) +[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="AtlasTexture" id="AtlasTexture_l4q1w"] -atlas = ExtResource("2_ahai6") -region = Rect2(3792, 222, 96, 210) +[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="AtlasTexture" id="AtlasTexture_qjaw0"] -atlas = ExtResource("2_ahai6") -region = Rect2(3888, 222, 96, 210) +[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="AtlasTexture" id="AtlasTexture_cjmr1"] -atlas = ExtResource("3_tnfoa") -region = Rect2(0, 0, 240, 144) +[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="AtlasTexture" id="AtlasTexture_0i1ge"] -atlas = ExtResource("3_tnfoa") -region = Rect2(240, 0, 240, 144) +[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="AtlasTexture" id="AtlasTexture_lss5r"] -atlas = ExtResource("3_tnfoa") -region = Rect2(480, 0, 240, 144) +[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="AtlasTexture" id="AtlasTexture_8ccj1"] -atlas = ExtResource("3_tnfoa") -region = Rect2(720, 0, 240, 144) +[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="AtlasTexture" id="AtlasTexture_lrp4n"] -atlas = ExtResource("3_tnfoa") -region = Rect2(960, 0, 240, 144) +[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="AtlasTexture" id="AtlasTexture_qnkpb"] -atlas = ExtResource("3_tnfoa") -region = Rect2(1200, 0, 240, 144) +[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="AtlasTexture" id="AtlasTexture_n03o5"] -atlas = ExtResource("2_ahai6") -region = Rect2(0, 192, 240, 144) +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_btgy7"] +animation = &"driving_left" -[sub_resource type="AtlasTexture" id="AtlasTexture_3k4i1"] -atlas = ExtResource("2_ahai6") -region = Rect2(240, 192, 240, 144) +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_d53q5"] +animation = &"driving_right" -[sub_resource type="AtlasTexture" id="AtlasTexture_pg1lo"] -atlas = ExtResource("2_ahai6") -region = Rect2(480, 192, 240, 144) +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_22qxt"] +animation = &"driving_up" -[sub_resource type="AtlasTexture" id="AtlasTexture_3b1y7"] -atlas = ExtResource("2_ahai6") -region = Rect2(720, 192, 240, 144) +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_o21fb"] +animation = &"driving_down" -[sub_resource type="AtlasTexture" id="AtlasTexture_1jisb"] -atlas = ExtResource("2_ahai6") -region = Rect2(960, 192, 240, 144) +[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="AtlasTexture" id="AtlasTexture_4lngy"] -atlas = ExtResource("2_ahai6") -region = Rect2(1200, 192, 240, 144) +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_3fbcc"] +animation = &"idling_left" -[sub_resource type="AtlasTexture" id="AtlasTexture_xng4i"] -atlas = ExtResource("2_ahai6") -region = Rect2(1440, 210, 96, 210) +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_11mhe"] +animation = &"idling_right" -[sub_resource type="AtlasTexture" id="AtlasTexture_yy3vy"] -atlas = ExtResource("2_ahai6") -region = Rect2(1536, 210, 96, 210) +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6x8m6"] +animation = &"idling_down" -[sub_resource type="AtlasTexture" id="AtlasTexture_cax1g"] -atlas = ExtResource("2_ahai6") -region = Rect2(1632, 210, 96, 210) +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ogtbq"] +animation = &"idling_up" -[sub_resource type="AtlasTexture" id="AtlasTexture_6dv7n"] -atlas = ExtResource("2_ahai6") -region = Rect2(1728, 210, 96, 210) +[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="AtlasTexture" id="AtlasTexture_7f8f4"] -atlas = ExtResource("2_ahai6") -region = Rect2(1824, 210, 96, 210) +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4uk5k"] +advance_mode = 2 +advance_expression = "velocity" -[sub_resource type="AtlasTexture" id="AtlasTexture_vy1dr"] -atlas = ExtResource("2_ahai6") -region = Rect2(1920, 210, 96, 210) +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_3q86p"] +advance_mode = 2 +advance_expression = "!velocity" -[sub_resource type="SpriteFrames" id="SpriteFrames_77j28"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_8fi8c") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_tgw3a") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_dj0xl") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_omrb2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_l4q1w") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_qjaw0") -}], -"loop": true, -"name": &"driving_down", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_cjmr1") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_0i1ge") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_lss5r") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_8ccj1") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_lrp4n") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_qnkpb") -}], -"loop": true, -"name": &"driving_left", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_n03o5") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_3k4i1") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_pg1lo") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_3b1y7") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_1jisb") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_4lngy") -}], -"loop": true, -"name": &"driving_right", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_xng4i") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_yy3vy") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_cax1g") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_6dv7n") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_7f8f4") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_vy1dr") -}], -"loop": true, -"name": &"driving_up", -"speed": 5.0 -}] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_0fk7h"] +advance_mode = 2 +advance_expression = "!velocity" -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_5yhvy"] -radius = 35.5 -height = 158.0 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6jgtk"] +advance_mode = 2 +advance_expression = "velocity" -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bevht"] -radius = 38.0026 -height = 150.043 +[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="CapsuleShape2D" id="CapsuleShape2D_w52g8"] -radius = 29.0752 -height = 172.0 +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_5fwej"] -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_j5vcu"] -radius = 33.0 -height = 174.0 +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_q5j17"] +graph_offset = Vector2(-249.333, -55.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"] -[node name="Area2D" type="Area2D"] -position = Vector2(-664, 181) +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_l8rwt"] +radius = 31.0 +height = 160.0 + +[node name="Car" type="CharacterBody2D"] +motion_mode = 1 script = ExtResource("1_vkq5y") -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] -rotation = -0.00268924 -sprite_frames = SubResource("SpriteFrames_77j28") -animation = &"driving_right" -autoplay = "driving_right" +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("4_0kman") +hframes = 12 +vframes = 4 -[node name="shapeDown" type="CollisionShape2D" parent="."] -position = Vector2(1.5, 16) -shape = SubResource("CapsuleShape2D_5yhvy") +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +root_node = NodePath("../..") +libraries = { +"": SubResource("AnimationLibrary_10pc8") +} -[node name="shapeUp" type="CollisionShape2D" parent="."] -position = Vector2(1, -20) -rotation = -0.00268924 -shape = SubResource("CapsuleShape2D_bevht") +[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.000397921, -0.120715) +parameters/TimeScale/scale = 1.0 -[node name="shapeLeft" type="CollisionShape2D" parent="."] -position = Vector2(-29, 29) +[node name="CollisionHorizontal" type="CollisionShape2D" parent="."] +position = Vector2(-4, 28) rotation = 1.5708 -shape = SubResource("CapsuleShape2D_w52g8") +shape = SubResource("CapsuleShape2D_l8rwt") -[node name="shapeRight" type="CollisionShape2D" parent="."] -position = Vector2(28, 27) -rotation = 1.5708 -shape = SubResource("CapsuleShape2D_j5vcu") +[node name="CollisionVertical" type="CollisionShape2D" parent="."] +position = Vector2(1, 2) +rotation = -3.14159 +shape = SubResource("CapsuleShape2D_l8rwt") diff --git a/vehicules/npc_car.tscn b/vehicules/npc_car.tscn index e48ec4d..ff0fb6b 100644 --- a/vehicules/npc_car.tscn +++ b/vehicules/npc_car.tscn @@ -1,20 +1,9 @@ -[gd_scene load_steps=3 format=3 uid="uid://cl201baro5y5"] +[gd_scene load_steps=2 format=3 uid="uid://cl201baro5y5"] [ext_resource type="Script" path="res://scenes/pathFollow.gd" id="1_fbnn2"] -[ext_resource type="PackedScene" uid="uid://bt1p311rn1h6q" path="res://vehicules/car.tscn" id="2_4yiv6"] [node name="voiture_pnj" type="PathFollow2D"] position = Vector2(-411, 81) rotates = false script = ExtResource("1_fbnn2") - -[node name="voiture" parent="." instance=ExtResource("2_4yiv6")] -position = Vector2(-1, 0) - -[node name="RayCast2D" type="RayCast2D" parent="."] -position = Vector2(1, 0) -target_position = Vector2(297, 58) - -[node name="RayCast2D2" type="RayCast2D" parent="."] -position = Vector2(1, 49) -target_position = Vector2(298, -47) +speed = 1.0