Rule
Rules are a way to define the evolution of elements over time. You can create a new rule on any element or kind with the builder method to.
Evolve to element
Section titled “Evolve to element”const space = vi.element("space", "blue");const alien = vi.element("alien", "green");
space.to(alien);[Image of a cell and 8 neighbors showing the transition between before and after]
Evolve to neighbor reference
Section titled “Evolve to neighbor reference”Instead of passing a predetermined element, you can also pass a neighbor.
space.to(vi.neighbor.TOP);In this example, space is going to evolve to whatever element is above it.