Inspiration
I recently discovered the [ConwayLife Forums](http://conwaylife.com/forums/) and thought that it would be really cool to try and put a spin on the idea.
What it does
It simulates Conway's game of life with two competing "species" following the same rules. If a given cell is surrounded by 3 other cells, the cell will turn a color equal to the majority of its neighbors. It also tracks a score for each side that is based on number of living cells and dead cells that were once a given color to further the 'competition' aspect. Users upload a black and white 128x64 image of the initial state and can step forward in the simulation to their desired point.
How I built it
The game board is rendered using Webgl to enable fast GPU accelerated rendering of the game board. The game logic and image handling is built using javascript. The board state is handled internally as a 2 dimensional array that is translated into a color buffer for my vertex and fragment shaders.
Challenges I ran into
I ran into a number of sneaky bugs that took me a while to find a solution to. I'm also relatively inexperienced with Javascript which meant I had to
Accomplishments that I'm proud of
It's really satisfying to watch.
What I learned
How canvas works, how buffers actually work in webgl beyond copy/paste boilerplate, anonymous functions, and a couple of odd javascript 'features.'
What's next for Competitive Game of Life
Automatic iteration synced with the renderer. Most documentation for WebGL is designed under the assumption that you want your animation and game logic decoupled from your framerate, which is normally good practice. The problem is that the Game of Life is the sort of simulation where every frame of the simulation is important to see.
Log in or sign up for Devpost to join the conversation.