Merge branch 'feat/2d_speed' into 'develop'

🧑‍💻 Measure speed ignoring vertical speed

See merge request open-fpsz/open-fpsz!80
This commit is contained in:
anyreso 2024-04-27 13:32:08 +00:00
commit 14b6b9ac28

View file

@ -39,10 +39,15 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta : float) -> void:
var velocity_xz : Vector3 = player.linear_velocity
velocity_xz.y = 0
text = \"\"
text += \"fps: %s\\n\" % str(Engine.get_frames_per_second())
text += \"position: %d, %d, %d\\n\" % [player.position.x, player.position.y, player.position.z]
text += \"speed: %d km/h\\n\" % (player.linear_velocity.length() * 3.6)
text += \"speed: %d km/h\\n\" % (player.linear_velocity.length() * 3.6)
text += \"speed_xz: %d km/h\\n\" % (velocity_xz.length() * 3.6)
"
[sub_resource type="Shader" id="Shader_gaah5"]