Skip to content

MisterDA/GameOfLife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Conway's Game of Life

This is my little implementation of the Conway's Game of Life, using a very simple algorithm.

It is written in Lua, using the amazing Löve2D framework.

Download

Löve and Lua are not required when running on OSX nor Windows, but if you use a UNIX-like or the standard .love file, you must get them from their website or from your distribution's repository. Notice that you can use love-release to make your own releases, after having cloned the project.

Controls

  • r fills the matrix with random generated cells,
  • c clears the matrix,
  • d toggles drawing mode,
  • space pauses the game,
  • up and down control the speed,
  • +, - and the mouse wheel can be used as zoom,
  • q or escape quit the game.

You can use d to enter in the drawing mode. While in drawing mode, left and right can be used to select a predefined lifeform. Just click anywhere to render the lifeform. To quit the drawing mode, press space or d again. Moreover, when you are not in the drawing mode, a simple click on a cell will change its state.

Lifeforms

You can write your own lifeforms and then use them in drawing mode. You just have to edit the lifeforms.lua file. Default is:

  • '#' for a living cell,
  • ' ' for a dead cell,
  • '$' for a newline.

Any number written before one of this characters will add n times this character. By example, ### (the blinker) is the same as 3#.

Future

In the future, I will try to improve the zoom, make rotation of pre-defined lifeform possible, and, why not, an Hashlife algorithm. Please have fun !

About

👾 A little Game of Life written in Lua with LÖVE

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages