save changes

This commit is contained in:
Gary Steven Keough 2024-12-14 23:13:06 -05:00
parent d751e1373b
commit 7bf0b39d60
2 changed files with 8 additions and 8 deletions

View File

@ -52,13 +52,12 @@ func _input(event):
func _physics_process(delta: float) -> void:
if current_ship != null:
if is_piloting: #if we are piloting a ship
global_transform.basis = current_ship.global_transform.basis
if is_piloting:
# global_transform.basis = current_ship.global_transform.basis
global_rotation.y = current_ship.global_rotation.y
else: #if we are NOT piloting a ship
velocity = walk(delta) + _gravity(delta) + _jump(delta)
global_rotation.y = current_ship.global_rotation.y
else:
velocity = walk(delta) + _gravity(delta) + _jump(delta)
else:
@ -99,8 +98,7 @@ func _handle_joypad_camera_rotation(delta: float, sens_mod: float = 1.0) -> void
func walk(delta: float) -> Vector3:
if Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
move_dir = Input.get_vector("move_left", "move_right", "move_forwards", "move_backwards")
var _forward: Vector3 = camera.global_transform.basis * Vector3(move_dir.x, 0, move_dir.y)
var walk_dir: Vector3 = Vector3(_forward.x, 0, _forward.z).normalized()
var walk_dir: Vector3 = Vector3(move_dir.x, 0, move_dir.y).normalized()
walk_vel = walk_vel.move_toward(walk_dir * speed * move_dir.length(), acceleration * delta)
return walk_vel

View File

@ -68,6 +68,7 @@ func _on_area_3d_body_entered(body):
body.player_entered_ship(global_position, self)
piloting_player = body
print(self.name)
body.reparent(self, true)
func _on_area_3d_body_exited(body):
@ -75,6 +76,7 @@ func _on_area_3d_body_exited(body):
body.player_exited_ship(global_position, self)
ship_is_piloted = false
piloting_player = null
body.reparent(get_node("/root/Devlevel"), true)
func _add_ship_helm(_ship_helm_scene: PackedScene):