Conway's Game of Life implemented in Lua for Corona Sdk
Conway’s Game of Life implemented in Lua for Corona Sdk
Press the ‘s’ key to start animating the cells
Touch on cells to make them dead or alive:
You can make some customization by editing main.lua
:
```lua
— 1. change the number of rows and cols by changing the cell size:
local cellsize = whatever_value_you_want
— or: change rows, cols and cell size arbitrarily by editing:
local grid = Grid.new { rows = rows, cols = cols, cellsize = cellsize }
— 2. comment this line to freely init cells by tapping on them
grid:random()
— 3. change (or add) the start key
if event.phase == “down” and key == your_key then
— stuff
end
— 4. change the frame rate (time is in milliseconds)
grid:animate(your_delay)
```