diff options
Diffstat (limited to 'game/shared/scripts/microgame.gd')
-rw-r--r-- | game/shared/scripts/microgame.gd | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/game/shared/scripts/microgame.gd b/game/shared/scripts/microgame.gd index cde93ba..1f38842 100644 --- a/game/shared/scripts/microgame.gd +++ b/game/shared/scripts/microgame.gd @@ -10,16 +10,21 @@ enum MICROGAME_CONTROL {HEAD_ON_KEYBOARD, INVERTED_HAND, ONLY_PINKY} @export var instructions = "" @export var win_on_timeout = true +var _timer: Timer + signal finished(won) +func get_time_left(): + return _timer.time_left + func _ready(): - var timer = Timer.new() - add_child(timer) - timer.one_shot = true - timer.start(MICROGAME_TIMER) + _timer = Timer.new() + add_child(_timer) + _timer.one_shot = true + _timer.start(MICROGAME_TIMER) - timer.timeout.connect(func(): + _timer.timeout.connect(func(): finished.emit(win_on_timeout) ) |