Browse Source

Moving pause check for clarity

master
Ryan Reed 1 year ago
parent
commit
47cade0dbc
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      world.gd

+ 2
- 2
world.gd View File

@ -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


Loading…
Cancel
Save