mirror of
https://codeberg.org/Melon-Bread/Comets.gd.git
synced 2025-07-06 22:54:36 -04:00
Allow the game over screen to grab proper focus when it opens
This commit is contained in:
@ -35,7 +35,6 @@ func game_over() -> void:
|
||||
# Wait 1 second before showing the game over screen for "dramatic" effect
|
||||
await get_tree().create_timer(1.0).timeout
|
||||
$UI/GameOverScreen.visible = true
|
||||
# TODO: Set focus on one of the buttons once the game over screen when shown
|
||||
|
||||
func increase_score(comet_size : int) -> void:
|
||||
# We add one since comet_size starts count at 0
|
||||
@ -46,3 +45,6 @@ func update_ui()-> void:
|
||||
# Label strings must be all caps for font to render proper
|
||||
$UI/Score.text = "SCORE: " + str(score)
|
||||
$UI/Level.text = "LEVEL: " + str(level)
|
||||
|
||||
|
||||
|
||||
|
@ -4,5 +4,7 @@ func _on_retry_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/game.tscn")
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
# TODO: Go to title screen instead of killing the game
|
||||
get_tree().quit()
|
||||
get_tree().change_scene_to_file("res://scenes/title_screen.tscn")
|
||||
|
||||
func _on_visibility_changed() -> void:
|
||||
$Panel/RetryButton.grab_focus()
|
||||
|
Reference in New Issue
Block a user