|
|
@ -12,6 +12,8 @@ enum CellStates { |
|
|
|
} |
|
|
|
|
|
|
|
## UI |
|
|
|
@onready var background_ui: Control = $UI/Background |
|
|
|
|
|
|
|
@onready var debug_ui: MarginContainer = $UI/Debug |
|
|
|
@onready var debug_generation_counter: Label = $UI/Debug/VBoxContainer/GenerationCounter |
|
|
|
@onready var debug_living_cells_counter: Label = $UI/Debug/VBoxContainer/LivingCellsCounter |
|
|
@ -43,13 +45,16 @@ var world: Array = [] |
|
|
|
func _ready() -> void: |
|
|
|
update_generation_ui() |
|
|
|
debug_ui.visible = false |
|
|
|
background_ui.visible = true |
|
|
|
generation_ui.visible = true |
|
|
|
|
|
|
|
func _input(event: InputEvent) -> void: |
|
|
|
if event.is_action_pressed("Pause"): |
|
|
|
is_paused = !is_paused |
|
|
|
background_ui.visible = is_paused |
|
|
|
if event.is_action_pressed("Menu"): |
|
|
|
is_paused = true |
|
|
|
background_ui.visible = true |
|
|
|
generation_ui.visible = true |
|
|
|
update_generation_ui() |
|
|
|
|
|
|
@ -197,6 +202,7 @@ func _on_generation_submit_pressed() -> void: |
|
|
|
|
|
|
|
debug_ui.visible = true |
|
|
|
generation_ui.visible = false |
|
|
|
background_ui.visible = false |
|
|
|
seed(world_seed) |
|
|
|
randomize() |
|
|
|
start_conway() |