teststrecke-game/scripts/rounds_selection.gd

16 lines
351 B
GDScript3
Raw Permalink Normal View History

2024-11-09 12:58:22 +00:00
extends OptionButton
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
2024-11-09 23:45:22 +00:00
var selectedRounds=Gamestate.getRounds()
select(selectedRounds-1) #preselect rounds
Gamestate.setRounds(selectedRounds)
2024-11-09 13:27:34 +00:00
2024-11-09 12:58:22 +00:00
func _on_item_selected(index: int) -> void:
Gamestate.setRounds(index+1)
print("Set rounds to "+str(index+1))