Yoghurt Culture is a colorful version of Conway's Game of Life, made with plain JavaScript and the HTML5 canvas. Four colonies of cells grow and fight for space in a petri dish, and you can draw your own cells with the mouse or your finger. It builds on the free Game of Life tutorial on spicyyoghurt.com.
This download gives you the complete project behind Yoghurt Culture. See how all the pieces fit together, or use it as a head start on a project of your own.
What's included:
- The complete code, fully commented and split into classes (JavaScript modules, no libraries or build tools)
- A settings file for the colors, the rules and the speed
- A README and a license
The petri dish itself has:
- Four colonies of cells: a new cell joins the colony that most of its parents belong to (a variant called QuadLife)
- Smooth animation between generations: new cells bud off from their parents, dying cells shrink away, and cells of the same colony merge into drops
- Drawing and erasing with the mouse, a finger or a pen
- Pause, Step, Random and Clear buttons
- A canvas that fills the screen and stays sharp, from phone to desktop
- Rules that are easy to change: switch to HighLife or Day & Night in the settings file
What you can do with it:
You can use the code in your own games and projects, including ones you sell. You don't have to credit us in your project. Just keep the short comment with our name at the top of each code file you use from this package. You can release your project anywhere, for example online or in an app store. Here's what you can't do:
- publish your project's source code, for example in a public repository, if it contains code from this package
- sell or share the code from this package on its own, for example in another source code package
- release Yoghurt Culture itself, unchanged or with only minor changes
LICENSE.txt in the zip has the full terms.
To run the project, you need a modern browser and a local web server, such as the Live Server extension for Visual Studio Code. The README explains how.
Want to learn how the Game of Life works? The free tutorial walks you through it step by step, from the rules to drawing your own cells: