update work

This commit is contained in:
Gary Steven Keough 2024-12-15 01:04:55 -05:00
parent 7b3359c565
commit 56583c3b6d
3 changed files with 8 additions and 21 deletions

View File

@ -11,6 +11,10 @@
[node name="Player" parent="." instance=ExtResource("2_q510b")] [node name="Player" parent="." instance=ExtResource("2_q510b")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.46532, 9.08969, 5.43659) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.46532, 9.08969, 5.43659)
speed = null
acceleration = null
jump_height = null
camera_sens = null
joystick_camera_sens_multiplier = 5.0 joystick_camera_sens_multiplier = 5.0
[node name="ShuttleClass" parent="." instance=ExtResource("3_lsckv")] [node name="ShuttleClass" parent="." instance=ExtResource("3_lsckv")]

View File

@ -23,8 +23,6 @@ var walk_vel: Vector3 # Walking velocity
var grav_vel: Vector3 # Gravity velocity var grav_vel: Vector3 # Gravity velocity
var jump_vel: Vector3 # Jumping velocity var jump_vel: Vector3 # Jumping velocity
var current_ship: Ship
func _ready() -> void: func _ready() -> void:
capture_mouse() capture_mouse()
@ -51,12 +49,8 @@ func _input(event):
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
if current_ship != null: if is_piloting:
if is_piloting: global_rotation.y = current_ship.global_rotation.y
global_rotation.y = current_ship.global_rotation.y
else:
velocity = walk(delta) + _gravity(delta) + _jump(delta)
else: else:
velocity = walk(delta) + _gravity(delta) + _jump(delta) velocity = walk(delta) + _gravity(delta) + _jump(delta)
@ -116,16 +110,6 @@ func _jump(delta: float) -> Vector3:
return jump_vel return jump_vel
func player_entered_ship(ship_global_position: Vector3, ship: Ship):
current_ship = ship
print("player entered ship: ", ship.ship_id)
func player_exited_ship(ship_global_position: Vector3, ship: Ship):
current_ship = null
print("player exited ship: ", ship.ship_id)
func set_is_piloting(state: bool): func set_is_piloting(state: bool):
is_piloting = state is_piloting = state
print("player is piloting: ", str(is_piloting)) print("player is piloting: ", str(is_piloting))

View File

@ -65,8 +65,7 @@ func _physics_process(delta):
func _on_area_3d_body_entered(body): func _on_area_3d_body_entered(body):
if body is Player: if body is Player and body.is_:
#print(self.name)
body.player_entered_ship(global_position, self) body.player_entered_ship(global_position, self)
piloting_player = body piloting_player = body
body.reparent(self, true) body.reparent(self, true)
@ -78,7 +77,7 @@ func _on_area_3d_body_exited(body):
body.player_exited_ship(global_position, self) body.player_exited_ship(global_position, self)
ship_is_piloted = false ship_is_piloted = false
piloting_player = null piloting_player = null
body.reparent(owner, true) #body.reparent(owner, true)
func _add_ship_helm(_ship_helm_scene: PackedScene): func _add_ship_helm(_ship_helm_scene: PackedScene):