Posts

Showing posts from January, 2020

Conway's Game of Life

Conway's Game of Life Conway’s Game of Life is a simple simulation of cells’ life-cycle. It consists of a plane made of many squares that all represent a cell, which is either alive or dead. The rules for survival are as follows: 2 or 3 alive neighboring cells lets a cell survive to the next generation Exactly 3 alive neighboring cells will revive a dead cell In all other cases, a cell will be dead So, in this simulation, a cell can be represented by a boolean value which represents either a dead or an alive cell as seen below. public struct CellComponent : IComponentData { public bool IsAlive ; } When the cell has been defined, it is time to spawn it into the world. This will be done by a ComponentSystem called SpawnSystem . This system will need an EntityArchetype which represents the Cell inside the simulation. It will also need a Material for a dead cell and a Mesh . Furthermore a static int2 is used to inform the other systems o...