Conway's Game of Life

    This is a modified demo of Conway's Game of Life that I created for a Flex Friday session. The colors of the cells change in hue as they age (red = young, blue = old). When cells reach their maximum age, they die. You can draw new cells with the mouse cursor. While you are able to draw during the simulation, this typically results in the cell immediately dying and is therefore difficult to notice.

Control Effect
Left Mouse Draw new cells (while held)
P Pause/Unpause
R Randomize grid
N Clear grid
S Save grid
L Load saved grid; empty by default
G While paused, enables grid (warning: this will slow down the framerate)

Reflections

    Surprisingly, there is still at least one stable shape even when cells can die of old age! Not all 2x2 px squares are stable, but they ocassionally can be, and seemingly via different methods.

    There are also semi-stable shapes, which should be familiar to our Game of Life scholars out there. They will continue to propogate new life so long as a single pixel is living, but when it dies of old age, the whole shape collapses. These are the non-2x2 configurations we would typically consider stable in standard Game of Life.

Future

    I'd like to make a version with more drawing tools, such as the ability to stamp famous patterns with a single mouse click. Hypothetically, this shouldn't be too hard. I'd also like to draw a pixel that follows the mouse cursor at the same resolution as the grid, so you can more easily tell where you are drawing, or where that hypothetical pattern would be placed. I'd like to fix the drawing tool so there are no gaps when you hold click down (due to mouse updates being spaced too far apart to detect overlap with a grid space). An eraser tool would be nice.