Skip to content

Commit

Permalink
Grab focus on level completed
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanito committed Nov 25, 2023
1 parent 19c53fd commit 0489ed3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions level_completed.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion world.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0489ed3

Please sign in to comment.