Skip to content

gregsabo/rgbcells

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is simply an implementation of Conway's Game of Life in coffeescript for the HTML canvas element. My goal was to make the code as easy-to-understand as possible. I tried to do this with semantically organized classes, as follows:

A Field is a 2d-array of Cells.
A Cell is a Neighborhood, some Effects, and a Billboard.
A Neighborhood is a set of references to eight nearby Cells.
An Effect is protected state which generates a Color for each frame depending on the state of the other Effects in the surrounding Neighborhood.
A Billboard is a rectangle that is repeatedly drawn on an HTML canvas in a certain Color.
A Color is some amount of alpha, red, green, and blue.

The program initializes a Field of Cells then repeatedly calculates the changes in Effects to each of those Cells, displaying the resulting Colors on Billboards using an HTML canvas.

About

Canvas game of life with color

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published