Added a HUD for both distance driven and current speed (in pixels and pixels/second respectively)

This commit is contained in:
KingGurke 2023-10-01 12:13:42 +02:00
parent 098033bbbf
commit 837408aaa3
5 changed files with 79 additions and 1 deletions

View file

@ -0,0 +1,15 @@
extends Control
#references
## reference to the speedometer label
@export var speed: Label
## reference to the distance meter label
@export var distance: Label
func _on_player_speed_changed(speed_float:float):
var speed_string = "%.02f" % speed_float
print_debug("changing speed display to ", speed_string)
speed.set_text(speed_string)
func _on_level_distance_changed(distance_float):
var distance_string ="%.f" % distance_float
distance.set_text(distance_string)