Improved network communication

This commit is contained in:
2024-01-24 20:57:31 +01:00
parent 26c52a00b3
commit 2738895efe
49 changed files with 427 additions and 625 deletions

23
client/camera/Camera.gd Normal file
View File

@ -0,0 +1,23 @@
extends Camera3D
@export var center: Node3D
@export var follow_speed: float
func _ready():
Global.camera = self
func _process(delta):
if Global.player == null:
return
center.position = lerp(center.position, Global.player.position, follow_speed * delta)
# @export var shake_strength: float
# var noise = FastNoiseLite.new()
# func shake(time):
# var trauma_sq := 1.0
# var h_offset := noise.get_noise_2d(time, 0) * trauma_sq * shake_strength
# var v_offset := noise.get_noise_2d(time, 1) * trauma_sq * shake_strength
# rotate_x(noise.get_noise_2d(time, 2) * trauma_sq * shake_strength)
# rotate_y(noise.get_noise_2d(time, 3) * trauma_sq * shake_strength)
# rotate_z(noise.get_noise_2d(time, 4) * trauma_sq * shake_strength)

View File

@ -0,0 +1,3 @@
[gd_resource type="CameraAttributesPractical" format=3 uid="uid://b835orxyqq6w5"]
[resource]