Ship mostly works #10

Merged
chrisbell merged 60 commits from feature/ship-syncing into develop 2024-12-29 04:35:51 +00:00
Showing only changes of commit 1197618572 - Show all commits

View File

@ -74,10 +74,11 @@ func handle_input(_delta: float):
# Apply torque for turning
if turn_input != 0:
var torque = Vector3.UP * turn_input * base_turn_speed
# Clamp the torque to the maximum turn speed
var clamped_torque = clamp(torque, Vector3(-max_turn_speed, -max_turn_speed, -max_turn_speed), Vector3(max_turn_speed, max_turn_speed, max_turn_speed))
apply_torque(clamped_torque)
apply_torque(torque)
# Clamp the angular velocity to the maximum turn speed
if angular_velocity.length() > max_turn_speed:
angular_velocity = angular_velocity.normalized() * max_turn_speed
# Apply force for forward and backward movement