diff options
-rw-r--r-- | Levels/Tut01.tscn | 2 | ||||
-rw-r--r-- | Scripts/car_behaviour.gd | 10 | ||||
-rw-r--r-- | Scripts/scene_control.gd | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Levels/Tut01.tscn b/Levels/Tut01.tscn index 8925d85..16066e4 100644 --- a/Levels/Tut01.tscn +++ b/Levels/Tut01.tscn @@ -23,7 +23,7 @@ outline_color = Color(0, 0, 0, 1) script = ExtResource("1_lcu5v") gold_medal_time = 2.0 silver_medal_time = 3.0 -bronze_medal_time = 4 +bronze_medal_time = 4.0 [node name="UI" parent="." instance=ExtResource("2_44idh")] 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 diff --git a/Scripts/scene_control.gd b/Scripts/scene_control.gd index 268c92a..b6e4a47 100644 --- a/Scripts/scene_control.gd +++ b/Scripts/scene_control.gd @@ -49,7 +49,7 @@ func get_path_next_position(pos): return path_follow.position func set_driving(driving: bool): - print('control driving: ' , driving) +# print('control driving: ' , driving) car.driving = driving is_driving = driving |