main_menu.gd 688 B

12345678910111213141516171819202122232425262728293031323334353637
  1. extends Control
  2. @onready var tree = get_tree()
  3. @onready var title = $TitleScreen
  4. @onready var start = $StartGame
  5. @onready var options = $Options
  6. func _on_Start_pressed():
  7. start.visible = true
  8. title.visible = false
  9. func _on_Options_pressed():
  10. options.prev_menu = title
  11. options.visible = true
  12. title.visible = false
  13. func _on_Exit_pressed():
  14. tree.quit()
  15. func _on_RandomBlocks_pressed():
  16. Settings.world_type = 0
  17. tree.change_scene_to_packed(preload("res://world/world.tscn"))
  18. func _on_FlatGrass_pressed():
  19. Settings.world_type = 1
  20. tree.change_scene_to_packed(preload("res://world/world.tscn"))
  21. func _on_BackToTitle_pressed():
  22. title.visible = true
  23. start.visible = false