diff --git a/course/lesson-15-modulo/visuals/TrafficLightsCondition.gd b/course/lesson-15-modulo/visuals/TrafficLightsCondition.gd index 5df5b803..6665ec5d 100644 --- a/course/lesson-15-modulo/visuals/TrafficLightsCondition.gd +++ b/course/lesson-15-modulo/visuals/TrafficLightsCondition.gd @@ -39,6 +39,7 @@ func run() -> void: func reset() -> void: + light_index = 0 turn_on_light(light_index, true) _index_label.text = str(light_index) diff --git a/course/lesson-15-modulo/visuals/TrafficLightsModulo.gd b/course/lesson-15-modulo/visuals/TrafficLightsModulo.gd index 093c6663..658bf1a2 100644 --- a/course/lesson-15-modulo/visuals/TrafficLightsModulo.gd +++ b/course/lesson-15-modulo/visuals/TrafficLightsModulo.gd @@ -36,6 +36,7 @@ func run() -> void: func reset() -> void: + light_index = 0 turn_on_light(light_index, true) _index_label.text = str(light_index) diff --git a/ui/components/RunnableCodeExample.gd b/ui/components/RunnableCodeExample.gd index e9758c9e..8895fc3a 100644 --- a/ui/components/RunnableCodeExample.gd +++ b/ui/components/RunnableCodeExample.gd @@ -123,7 +123,7 @@ func step() -> void: _scene_instance.has_method("run"), "Node %s does not have a run method" % [get_path()] ) - if _scene_instance.has_method("reset"): + if _scene_instance.has_method("reset") and _debugger: _scene_instance.reset() # warning-ignore:unsafe_method_access