From 0b86031505b0e0609211743025ef06d25428fc46 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sat, 9 Nov 2024 11:54:56 +0100 Subject: [PATCH] fix elapsed timer on new round --- scripts/game.gd | 1 + scripts/gamestate.gd | 3 +++ 2 files changed, 4 insertions(+) diff --git a/scripts/game.gd b/scripts/game.gd index a522a0d..432b3f5 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -33,6 +33,7 @@ var game_ended=false # Called when the node enters the scene tree for the first time. func _ready() -> void: + Gamestate.resetTimeElapsed() countdown.start() countdown_label.visible=true diff --git a/scripts/gamestate.gd b/scripts/gamestate.gd index 4e4b194..13a8901 100644 --- a/scripts/gamestate.gd +++ b/scripts/gamestate.gd @@ -56,3 +56,6 @@ func addTimeElapsed(delta): func getTimeElapsed(): return time_elapsed + +func resetTimeElapsed(): + time_elapsed=0