diff --git a/world.gd b/world.gd index 701c1ff..cdd67c4 100644 --- a/world.gd +++ b/world.gd @@ -11,6 +11,8 @@ enum CellStates { ALIVE, } +@onready var camera: Camera2D = $Camera2D + @onready var generation_counter: Label = $CanvasLayer/Debug/VBoxContainer/GenerationCounter @onready var generation_timer: Timer = $GenerationTimer @onready var living_cells_counter: Label = $CanvasLayer/Debug/VBoxContainer/LivingCellsCounter @@ -35,6 +37,10 @@ func _ready() -> void: generate_world() + # Center the camea on the world + camera.position.x = world_size.x * cell_size.x / 2 + camera.position.y = world_size.y * cell_size.y / 2 + ## Check a cell against the Conway rules and return True if cell shoudl be alive func cell_is_alive(pos: Vector2) -> bool: