init
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
extends Label
|
||||
|
||||
@export var boat: Boat # drag the Crate into this slot in the inspector
|
||||
@export var world: WorldManager
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if boat == null:
|
||||
text = "no boat"
|
||||
return
|
||||
|
||||
var forward := -boat.global_basis.z
|
||||
forward.y = 0.0
|
||||
var speed := boat.linear_velocity.dot(forward.normalized())
|
||||
var pos := world.true_position(boat)
|
||||
|
||||
text = "Throttle: %+.0f %%
|
||||
Speed: %.1f m/s
|
||||
Submerged: %.0f %%
|
||||
Position: (%.0f, %.0f)
|
||||
" % [
|
||||
boat.throttle * 100.0,
|
||||
speed,
|
||||
boat.submerged_ratio * 100.0,
|
||||
boat.global_position.x,
|
||||
boat.global_position.z,
|
||||
]
|
||||
Reference in New Issue
Block a user