A raging quest

This commit is contained in:
2026-02-25 19:46:10 -06:00
parent 2670392e2d
commit bf1ac4406c
9 changed files with 345 additions and 22 deletions
+10 -5
View File
@@ -2,6 +2,8 @@ extends RigidBody3D
# Initially I used a CharacterBody3D, however, I wanted the player to bounce off
# other objects in the environment and that would have required manual handling
# of collisions. So that's why we're using a RigidBody3D instead.
signal vehicle_entered(vehicle: Node)
signal vehicle_exited(vehicle: Node)
const MOVE_SPEED := 8.0
const SPRINT_MOVE_SPEED :=13
@@ -94,11 +96,6 @@ func _integrate_forces(state):
# Input as 2D vector
var input2v := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
if Input.is_action_just_pressed("player_phone"):
phone_visible = !phone_visible
if phone:
phone.visible = phone_visible
# Camera based movement
var forward := Vector3.FORWARD * -1.0
var right := Vector3.RIGHT
@@ -157,6 +154,12 @@ func _integrate_forces(state):
_jump_triggered = false
func _input(event):
if event.is_action_pressed("player_phone"):
phone_visible = !phone_visible
if phone:
phone.visible = phone_visible
return
if _in_vehicle:
return
if event is InputEventMouseButton:
@@ -226,6 +229,7 @@ func enter_vehicle(_vehicle: Node, seat: Node3D, vehicle_camera: Camera3D) -> vo
cam.current = false
if vehicle_camera:
vehicle_camera.current = true
vehicle_entered.emit(_vehicle)
func exit_vehicle(exit_point: Node3D, vehicle_camera: Camera3D) -> void:
_in_vehicle = false
@@ -245,3 +249,4 @@ func exit_vehicle(exit_point: Node3D, vehicle_camera: Camera3D) -> void:
vehicle_camera.current = false
if cam:
cam.current = true
vehicle_exited.emit(null)