voitures: freinage en fonction du time delta

le freinage dure un certain temps et ce temps dépends du delta des
frames. Sinon les voitures freinent plus ou moins vite en fonction de ce
que les pc cibles sont capable d'arriver à faire tourner.
This commit is contained in:
Thomas
2025-02-26 16:20:58 +01:00
parent 41573e0753
commit afcfa60804
9 changed files with 74 additions and 19 deletions

57
scenes/staD86C.tmp Normal file
View File

@@ -0,0 +1,57 @@
[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, -72.1029, 112.165, 72.1029, -112.165, 20, 84, -92.8736, 1.22052, 92.8736, -1.22052, 220, -16, -72.4586, -10.5935, 72.4586, 10.5935, 2206, -11, -122.624, -4.07119, 122.624, 4.07119, 2387, 165, -98.6077, 103.694, 98.6077, -103.694, 2759, 110, 117.462, 37.6927, -117.462, -37.6927, 2715, -276, 114.239, -35.1712, -114.239, 35.1712, 2384, -293, 50.2246, -13.5362, -50.2246, 13.5362, 2209, -126, 61.4659, 8.33138, -61.4659, -8.33138, 133, -135, 40.4345, 62.8385, -40.4345, -62.8385, 40, -272, 50.2081, -75.7177, -50.2081, 75.7177, -399, -242, -67.7454, -78.8949, 67.7454, 78.8949, -399, 107, 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, 1938, 1371, 0, 0, 0, 0, 1931, 342, 0, 0, 0, 0, 2082, 333, 0, 0, 0, 0, 2086, -88, 0, 0, 0, 0, 1656, -97, 0, 0, 0, 0, 1649, 73, 0, 0, 0, 0, 912.469, 60.5339, 0, 0, 0, 0, 904, -1165, 0, 0, 0, 0, -890, -1162, 0, 0, 0, 0, -885, -108, 0, 0, 0, 0, -1062, -106, 0, 0, 0, 0, -1073, 283, 0, 0, 0, 0, -624, 293, 0, 0, 0, 0, -616, 161, 0, 0, 0, 0, -577, 160, 0, 0, 0, 0, 823, 165, 0, 0, 0, 0, 802, 305, 0, 0, 0, 0, 806, 1560)
}
point_count = 21
[node name="scene1" type="Node2D"]
[node name="world" parent="." instance=ExtResource("1_6vs81")]
[node name="movibles" type="Node2D" parent="."]
[node name="player" parent="movibles" instance=ExtResource("2_5x6b5")]
position = Vector2(87, 74)
[node name="cars" type="Node" parent="movibles"]
[node name="Path2D" type="Path2D" parent="movibles/cars"]
position = Vector2(-664, 181)
curve = SubResource("Curve2D_shblg")
[node name="voiture_pnj" parent="movibles/cars/Path2D" node_paths=PackedStringArray("car", "world") instance=ExtResource("3_yuakw")]
position = Vector2(-285, 193)
car = NodePath("../Car")
world = NodePath("../../../../world")
[node name="Car" parent="movibles/cars/Path2D" instance=ExtResource("4_bqm78")]
position = Vector2(-287, 196)
speed = null
timeToChangeVelocity = null
[node name="Path2D2" type="Path2D" parent="movibles/cars"]
curve = SubResource("Curve2D_nircx")
[node name="voiture_pnj" parent="movibles/cars/Path2D2" node_paths=PackedStringArray("car", "world") instance=ExtResource("3_yuakw")]
position = Vector2(803, 1569)
car = NodePath("../Car")
distanceMax = 150
world = NodePath("../../../../world")
[node name="Car" parent="movibles/cars/Path2D2" instance=ExtResource("4_bqm78")]
position = Vector2(803, 1558)
speed = 500
timeToChangeVelocity = null