aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts/car_behaviour.gd
diff options
context:
space:
mode:
authorLibravatar perivesta <>2023-07-09 19:04:56 +0200
committerLibravatar perivesta <>2023-07-09 19:04:56 +0200
commit54ac5fe2f9788c449a867d253f34536b3cfe800d (patch)
treebc7064652a3b8b0f9a9324f8ede5bf5c6bcaec06 /Scripts/car_behaviour.gd
parentc8555832f0fa74803621e2d85090b267bda42f58 (diff)
download2023-54ac5fe2f9788c449a867d253f34536b3cfe800d.tar.gz
2023-54ac5fe2f9788c449a867d253f34536b3cfe800d.tar.bz2
2023-54ac5fe2f9788c449a867d253f34536b3cfe800d.zip
remove debug prints
Diffstat (limited to 'Scripts/car_behaviour.gd')
-rw-r--r--Scripts/car_behaviour.gd10
1 files changed, 5 insertions, 5 deletions
diff --git a/Scripts/car_behaviour.gd b/Scripts/car_behaviour.gd
index 1a69b37..a881363 100644
--- a/Scripts/car_behaviour.gd
+++ b/Scripts/car_behaviour.gd
@@ -110,22 +110,22 @@ func own_movement(delta):
func own_movement_improved(delta):
var desired_velocity = chosen_dir.rotated(rotation) * max_speed
- print('==========')
- print('current speed: ', velocity.length(), ' | current angle: ', velocity.angle())
- print('desired speed: ', desired_velocity.length(), ' | desired angle: ', desired_velocity.angle())
+# print('==========')
+# print('current speed: ', velocity.length(), ' | current angle: ', velocity.angle())
+# print('desired speed: ', desired_velocity.length(), ' | desired angle: ', desired_velocity.angle())
# var possible_radius = mass * velocity.length_squared() / steer_force
# var possible_steer_angle = velocity.length() / possible_radius
var possible_steer_angle = steer_force / (mass * velocity.length())
var angle_change = clampf(wrapf(desired_velocity.angle() - velocity.angle(), -PI, PI), -possible_steer_angle, possible_steer_angle)
var new_angle = wrapf(velocity.angle() + angle_change, -PI, PI)
- print('possible_steer_angle: ', possible_steer_angle, ' | angle_change: ', angle_change, ' | new_angle: ', new_angle )
+# print('possible_steer_angle: ', possible_steer_angle, ' | angle_change: ', angle_change, ' | new_angle: ', new_angle )
var wanted_speed = steer_force / (mass * absf(desired_velocity.angle() - velocity.angle()))
var new_max_speed = min(velocity.length() + (acceleration), max_speed)
var new_min_speed = max(velocity.length() - (acceleration), 0)
var new_speed = clampf(wanted_speed, new_min_speed, new_max_speed)
- print('wanted: ', wanted_speed, ' | min: ', new_min_speed, ' | max: ', new_max_speed, ' | new: ', new_speed)
+# print('wanted: ', wanted_speed, ' | min: ', new_min_speed, ' | max: ', new_max_speed, ' | new: ', new_speed)
velocity = Vector2.from_angle(new_angle) * new_speed
rotation = new_angle