mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-07-12 18:43:49 +00:00
feat(*): Add hud with timer
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user