:game_die: Interactive Conway's Game of Life simulation written in Haxe
Conway's Game of Life written using Haxe and WebGL. Run it in your browser.
Run the demo, and press anywhere on the Game of Life canvas to add a pattern to the simulation. Here it is in action:
Select from thousands of different Life patterns via the selection dropdown or the pattern previews section:
Resize the browser window to change the simulation size. The canvas scales by powers of two (1024x512, 1024x1024 etc):
The Game of Life is a cellular automaton invented by John Conway in 1970. It is a simulation that takes place on a two-dimensional orthogonal grid of square cells, each of which can either be dead or alive.
Each time the simulation is updated, every cell in the grid interacts with its eight neighboring cells in accordance with these four rules:
Conway designed these rules to produce interesting results - even self replicating patterns can be produced. Read more here.
In this implementation, the Game of Life rules are applied via a GLSL shader that runs on the graphics card. It uses a ping-pong technique with two render targets: one render target contains the current simulation step, and the other receives the results of applying the rules of the game to produce the next simulation step. In other words, we use the output of the last simulation step as input to the next one, alternating between render targets on every step.