mew
This commit is contained in:
parent
6ce339b430
commit
314f485f01
15 changed files with 318 additions and 17 deletions
8
uiman.gd
8
uiman.gd
|
|
@ -25,6 +25,12 @@ func _process(delta: float) -> void:
|
|||
else:
|
||||
speed_label.text = str(round(snake_manager.max_snake_speed*100)/100) + " MAX"
|
||||
speed_label.label_settings.font_color = Color.RED
|
||||
if snake_manager.burn_apples > 0:
|
||||
food_bar.modulate = Color.GREEN
|
||||
elif food_bar.value < food_bar.max_value*0.3:
|
||||
food_bar.modulate = Color.RED
|
||||
else:
|
||||
food_bar.modulate = Color.WHITE
|
||||
|
||||
func show_gameover():
|
||||
gameover_screen.show()
|
||||
|
|
@ -32,9 +38,11 @@ func show_gameover():
|
|||
|
||||
func _on_again_button_pressed() -> void:
|
||||
get_tree().get_root().process_mode = Node.PROCESS_MODE_ALWAYS
|
||||
Router.player_mode = false
|
||||
get_tree().change_scene_to_file("res://test.tscn")
|
||||
|
||||
|
||||
func _on_menu_button_pressed() -> void:
|
||||
get_tree().get_root().process_mode = Node.PROCESS_MODE_ALWAYS
|
||||
Router.player_mode = false
|
||||
get_tree().change_scene_to_file("res://scenes/menu.tscn")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue