diff --git a/level_completed.gd b/level_completed.gd index ef6955e..099923a 100644 --- a/level_completed.gd +++ b/level_completed.gd @@ -9,10 +9,6 @@ signal next_level @onready var best_time_label = %BestTimeLabel -func _ready(): - next_level_button.grab_focus() - - func set_times(your_time, best_time): your_time_label.text = "Your Time: " + str(your_time / 1000.0) best_time_label.text = "Best Time: " + str(best_time / 1000.0) diff --git a/world.gd b/world.gd index a27e2b6..20608c6 100644 --- a/world.gd +++ b/world.gd @@ -35,11 +35,11 @@ func _process(_delta): func show_level_completed(): level_completed.show() - var level_name = get_tree().current_scene.name HighScores.add_time(level_name, level_time) level_completed.set_times(level_time, HighScores.get_best_time(level_name)) level_time_label.visible = false + level_completed.next_level_button.grab_focus() get_tree().paused = true