|
@ -52,6 +52,8 @@ func _ready() -> void: |
|
|
|
|
|
|
|
|
func _input(event: InputEvent) -> void: |
|
|
func _input(event: InputEvent) -> void: |
|
|
if event.is_action_pressed("Pause"): |
|
|
if event.is_action_pressed("Pause"): |
|
|
|
|
|
if is_paused: generation_timer.start() |
|
|
|
|
|
else: generation_timer.stop() |
|
|
is_paused = !is_paused |
|
|
is_paused = !is_paused |
|
|
background_ui.visible = is_paused |
|
|
background_ui.visible = is_paused |
|
|
if event.is_action_pressed("Menu"): |
|
|
if event.is_action_pressed("Menu"): |
|
@ -132,8 +134,6 @@ func count_living_neighbors(pos: Vector2) -> int: |
|
|
|
|
|
|
|
|
## Loop through world to generate cell states, hide/show cells depending on state |
|
|
## Loop through world to generate cell states, hide/show cells depending on state |
|
|
func process_generation() -> void: |
|
|
func process_generation() -> void: |
|
|
if is_paused: return |
|
|
|
|
|
|
|
|
|
|
|
generation += 1 |
|
|
generation += 1 |
|
|
total_living = 0 |
|
|
total_living = 0 |
|
|
|
|
|
|
|
|