Files
CosmicClash/Game/scripts/time_left_label.gd
T

15 lines
360 B
GDScript

extends Label3D
var time_left : int = 10
func _ready():
$".".text = "Time left: " + str(time_left) + "s"
func _on_time_left_timer_timeout():
time_left -= 1
$".".text = "Time left: " + str(time_left) + "s"
print(time_left)
if time_left == 0:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
get_tree().change_scene_to_file("res://scenes/main_menu.tscn")