Conway’s Game of Life in pure AS3
by Ian
Here is Conway’s Game of Life using straight AS3 and no pixel bender. At first I created a straight forward implementation, reading each cell and analyzing the neighbors. This was dreadfully slow in straight as3, so I looked into other solving techniques. I ended up using a technique similar to Tony Finch’s List Life and Keno März’s. By only keeping track of the live cells it is easy to determine the relative neighbors and skip the whitespace, saving a very decent amount of processing time. The result is much faster than the pixel bender version I previously implemented. I will be continuing to extend features and optimize this version.
‘space’ pauses the simulation.
While paused, you can step a single iteration by pressing the ‘right’ arrow.
‘w/a/s/d’ moves the player cell.
‘up/down/left/right’ shoots a cell in that direction.
‘ctrl’+click warps the player cell to the mouse location.
clicking and/or dragging on the stage adds cells for the simulation to solve.
edit the brush by clicking on it’s icon or “draw”.
dragging the ’100%’ button allows you to zoom in up to 600%.
