summaryrefslogtreecommitdiff
path: root/countdown.gd
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-11-18 02:11:52 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-11-18 02:11:52 +0100
commit95f0826c2c168b34d41c8d1eed853ce4c9dc018c (patch)
tree2e9cd4e7e997782c6e1a588c3fc764aa624feed2 /countdown.gd
parent41be616f2dd56bdc58df50f568c6efbf944742eb (diff)
downloadnj26-95f0826c2c168b34d41c8d1eed853ce4c9dc018c.tar.gz
Set countdown.tscn as child of Spatial.tscn
Diffstat (limited to 'countdown.gd')
-rw-r--r--countdown.gd5
1 files changed, 3 insertions, 2 deletions
diff --git a/countdown.gd b/countdown.gd
index 7788576..b18c3d8 100644
--- a/countdown.gd
+++ b/countdown.gd
@@ -3,11 +3,12 @@ extends Node2D
signal timeout
func _process(_delta):
- if $Timer.time_left < 1:
+ if $Timer.time_left < 1 and not $Timer.is_stopped():
emit_signal("timeout")
+ $CanvasLayer/CenterContainer/countdown.visible = false
$CanvasLayer/CenterContainer/countdown.text = "%d" % $Timer.time_left
# Called when the node enters the scene tree for the first time.
func _ready():
- $Timer.start(5)
+ $Timer.start()