Menu.gd 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. extends Node2D
  2. func _ready():
  3. $Camera2D.make_current()
  4. $TimeMachine.can_use = false
  5. func _on_PlayButton_pressed():
  6. $Transit.change_scene("res://levels/Level_One.tscn", 0.5, 0.2)
  7. func _on_PlayButton_mouse_entered():
  8. $VBoxContainer/HBoxContainer/TextureRect/PlayButton/selected.visible = true
  9. $VBoxContainer/HBoxContainer/TextureRect/LoadButton/selected.visible = false
  10. $VBoxContainer/HBoxContainer/TextureRect/SettingsButton/selected.visible = false
  11. $VBoxContainer/HBoxContainer/TextureRect/ExitButton/selected.visible = false
  12. func _on_LoadButton_pressed():
  13. $TimeMachine.continue_game()
  14. func _on_LoadButton_mouse_entered():
  15. $VBoxContainer/HBoxContainer/TextureRect/PlayButton/selected.visible = false
  16. $VBoxContainer/HBoxContainer/TextureRect/LoadButton/selected.visible = true
  17. $VBoxContainer/HBoxContainer/TextureRect/SettingsButton/selected.visible = false
  18. $VBoxContainer/HBoxContainer/TextureRect/ExitButton/selected.visible = false
  19. func _on_SettingsButton_pressed():
  20. pass
  21. func _on_SettingsButton_mouse_entered():
  22. $VBoxContainer/HBoxContainer/TextureRect/PlayButton/selected.visible = false
  23. $VBoxContainer/HBoxContainer/TextureRect/LoadButton/selected.visible = false
  24. $VBoxContainer/HBoxContainer/TextureRect/SettingsButton/selected.visible = true
  25. $VBoxContainer/HBoxContainer/TextureRect/ExitButton/selected.visible = false
  26. func _on_ExitButton_pressed():
  27. get_tree().quit()
  28. func _on_ExitButton_mouse_entered():
  29. $VBoxContainer/HBoxContainer/TextureRect/PlayButton/selected.visible = false
  30. $VBoxContainer/HBoxContainer/TextureRect/LoadButton/selected.visible = false
  31. $VBoxContainer/HBoxContainer/TextureRect/SettingsButton/selected.visible = false
  32. $VBoxContainer/HBoxContainer/TextureRect/ExitButton/selected.visible = true