small racing game im working on
Diffstat (limited to 'classes/car.gd')
-rw-r--r--classes/car.gd6
1 files changed, 4 insertions, 2 deletions
diff --git a/classes/car.gd b/classes/car.gd
index 8d3a23c..e9acc26 100644
--- a/classes/car.gd
+++ b/classes/car.gd
@@ -42,12 +42,14 @@ func is_on_ground() -> bool:
func is_not_on_ground() -> bool:
return wheels.any(func(whl: VehicleWheel3D): return !whl.is_in_contact())
+func reset() -> void:
+ brake = 15
+ set_physics_process(false)
+
func _ready() -> void:
for whl in wheels:
particles.append(whl.get_node(^"particles"))
randomize()
- brake = 15
- set_physics_process(false)
func kph():
return (3 * PI * wheels[0].wheel_radius * rpm()) / 25;