feat(*): Add hud with timer

This commit is contained in:
Josh Creek
2025-07-13 18:36:48 +01:00
parent bdd0244873
commit 5ad381cf2f
7 changed files with 66 additions and 23 deletions
+12
View File
@@ -5,6 +5,18 @@ var speed = 10.0
@onready var camera : Camera3D = get_node("Camera3D")
@onready var ball = get_parent().get_node("Ball")
@onready var timer_label = get_node("HUD/Control/TimerLabel")
func _ready():
var game_scene = get_parent()
if game_scene and game_scene.has_signal("timer_updated"):
game_scene.timer_updated.connect(_on_timer_updated)
print("Connected to game scene timer signal")
else:
print("Game scene not found or doesn't have timer_updated signal")
func _on_timer_updated(minutes: int, seconds: int):
timer_label.text = "%02d:%02d" % [minutes, seconds]
func _physics_process(_delta):
if ball and camera: