项目作者: Luca96

项目描述 :
Conway's Game of Life implemented in Lua for Corona Sdk
高级语言: Lua
项目地址: git://github.com/Luca96/conway-game-of-life-corona-sdk.git
创建时间: 2018-04-05T16:04:09Z
项目社区:https://github.com/Luca96/conway-game-of-life-corona-sdk

开源协议:MIT License

下载


Conway’s Game of Life

Conway’s Game of Life implemented in Lua for Corona Sdk

Usage:

  • Press the ‘s’ key to start animating the cells

  • Touch on cells to make them dead or alive:

    • a dead (white) cell became alive (black) when touched
    • an alive (black) cell became dead (white) when touched
  • 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)
```

Example:

GoL gif