Compare commits
No commits in common. "feature/player-features" and "develop" have entirely different histories.
feature/pl
...
develop
Binary file not shown.
@ -13,7 +13,6 @@ height = 1.5
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_qlkab"]
|
||||
radius = 0.35
|
||||
height = 2.25001
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_vu2l8"]
|
||||
radius = 0.35
|
||||
@ -25,7 +24,7 @@ shader = ExtResource("3_rakxt")
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0n7pd"]
|
||||
shader = ExtResource("3_rakxt")
|
||||
|
||||
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "neck", "player_avatar_face", "body", "head", "player_hud", "flashlight")]
|
||||
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "neck", "player_avatar_face", "body", "head", "player_hud")]
|
||||
collision_mask = 242
|
||||
script = ExtResource("1_bv7t4")
|
||||
camera = NodePath("Neck/Camera3D")
|
||||
@ -34,7 +33,6 @@ player_avatar_face = NodePath("Neck/Camera3D/PlayerAvatarFace")
|
||||
body = NodePath("Body")
|
||||
head = NodePath("Neck/Head")
|
||||
player_hud = NodePath("PlayerHUD")
|
||||
flashlight = NodePath("Neck/Camera3D/Flashlight")
|
||||
|
||||
[node name="PlayerTag" type="Label3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.26654, 0)
|
||||
@ -48,7 +46,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
|
||||
mesh = SubResource("CapsuleMesh_v7b3h")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.125501, 0)
|
||||
shape = SubResource("CapsuleShape3D_qlkab")
|
||||
|
||||
[node name="Neck" type="Node3D" parent="."]
|
||||
@ -69,9 +66,6 @@ shaded = true
|
||||
double_sided = false
|
||||
texture = ExtResource("2_omgn1")
|
||||
|
||||
[node name="Flashlight" type="SpotLight3D" parent="Neck/Camera3D"]
|
||||
spot_range = 9.0
|
||||
|
||||
[node name="Head" type="MeshInstance3D" parent="Neck"]
|
||||
mesh = SubResource("SphereMesh_vu2l8")
|
||||
|
||||
|
@ -11,32 +11,35 @@ var steam_id: int = 0
|
||||
@export_category("Player")
|
||||
@export_range(1, 35, 1) var speed: float = 5.0
|
||||
@export_range(10, 400, 1) var acceleration: float = 100.0
|
||||
|
||||
@export_range(0.1, 3.0, 0.1) var jump_height: float = 1.0
|
||||
@export_range(0.1, 3.0, 0.1, "or_greater") var camera_sens: float = 1.0
|
||||
@export_range(0.1, 3.0, 0.1, "or_greater") var joystick_camera_sens_multiplier: float = 5.0
|
||||
@export_category("Node References")
|
||||
@export var camera: Camera3D
|
||||
@export var neck: Node3D
|
||||
@export var player_avatar_face: Sprite3D
|
||||
@export var body: MeshInstance3D
|
||||
@export var head: MeshInstance3D
|
||||
@export var player_hud: CanvasLayer
|
||||
@export var flashlight: SpotLight3D
|
||||
|
||||
|
||||
var jumping: bool = false
|
||||
var is_using_joystick: bool = false
|
||||
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
|
||||
var move_dir: Vector2 # Input direction for movement
|
||||
var look_dir: Vector2 # Input direction for look/aim
|
||||
var walk_vel: Vector3 # Walking velocity
|
||||
var grav_vel: Vector3 # Gravity velocity
|
||||
var jump_vel: Vector3 # Jumping velocity
|
||||
|
||||
var current_ship: Ship
|
||||
|
||||
var previous_global_position: Vector3
|
||||
var previous_global_rotation: Vector3
|
||||
var previous_head_vert_rotation: Vector3
|
||||
|
||||
var neck_rotation_sync: Vector3
|
||||
var light_state: bool
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@ -75,9 +78,6 @@ func _input(event):
|
||||
if Input.is_action_just_pressed("jump") and !is_piloting:
|
||||
jumping = true
|
||||
|
||||
if Input.is_action_just_released("toggle_flashlight"):
|
||||
handle_flashlight(event)
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if !is_network_authority: return
|
||||
@ -163,17 +163,6 @@ func _jump(delta: float) -> Vector3:
|
||||
return jump_vel
|
||||
|
||||
|
||||
func handle_flashlight(event):
|
||||
if !flashlight.visible:
|
||||
flashlight.show()
|
||||
light_state = true
|
||||
NetworkManager.sync_property_to_all(network_uuid, "light_state", light_state)
|
||||
elif flashlight.visible:
|
||||
flashlight.hide()
|
||||
light_state = false
|
||||
NetworkManager.sync_property_to_all(network_uuid, "light_state", light_state)
|
||||
|
||||
|
||||
func player_entered_ship(ship_global_position: Vector3, ship: Ship):
|
||||
if !is_network_authority: return
|
||||
current_ship = ship
|
||||
|
@ -121,8 +121,8 @@ func send_network_update():
|
||||
|
||||
elif !NetworkManager.is_host and ship_is_piloted and piloting_player.steam_id == NetworkManager.steam_id:
|
||||
# Client is piloting, send updates to the host
|
||||
NetworkManager.sync_property_to_all(network_uuid, "global_position", predicted_position)
|
||||
NetworkManager.sync_property_to_all(network_uuid, "global_rotation", predicted_rotation)
|
||||
NetworkManager.sync_property_to_all_except_host(network_uuid, "global_position", predicted_position)
|
||||
NetworkManager.sync_property_to_all_except_host(network_uuid, "global_rotation", predicted_rotation)
|
||||
|
||||
func receive_global_position_update(value: Vector3):
|
||||
target_position = value
|
||||
|
Binary file not shown.
@ -135,12 +135,6 @@ interact={
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
toggle_flashlight={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user