|
@ -37,7 +37,7 @@ func _ready() -> void: |
|
|
|
|
|
|
|
|
generate_world() |
|
|
generate_world() |
|
|
|
|
|
|
|
|
# Center the camea on the world |
|
|
|
|
|
|
|
|
# Center the camera on the world |
|
|
camera.position.x = world_size.x * cell_size.x / 2 |
|
|
camera.position.x = world_size.x * cell_size.x / 2 |
|
|
camera.position.y = world_size.y * cell_size.y / 2 |
|
|
camera.position.y = world_size.y * cell_size.y / 2 |
|
|
|
|
|
|
|
@ -122,7 +122,7 @@ func kill_cell(pos: Vector2) -> CellStates: |
|
|
return CellStates.DEAD |
|
|
return CellStates.DEAD |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Generate the world with the initial cells |
|
|
|
|
|
|
|
|
## Generate the world with cells in random states (alive or dead) |
|
|
func generate_world() -> void: |
|
|
func generate_world() -> void: |
|
|
for x in range(world_size.x): |
|
|
for x in range(world_size.x): |
|
|
world.append([]) |
|
|
world.append([]) |
|
|