new GameOfLife(rows, lines, pattern)
Game Of Life object constructor
Parameters:
Name | Type | Description |
---|---|---|
rows |
int | Game's board(grid) rows |
lines |
int | Game's board(grid) lines |
pattern |
array | initial pattern to paint on board |
Methods
(static) drawCell(x, y)
Draws a single cell on game's grid.
Used for manual paint on grid by user.
Parameters:
Name | Type | Description |
---|---|---|
x |
int | |
y |
int |
(static) init()
init game's state on grid
(static) setPattern(pattern)
Sets pattern property (later to be set on game's grid)
Parameters:
Name | Type | Description |
---|---|---|
pattern |
array |
(static) start()
Starts game
(static) stop()
Stops game
(static) tick()
update the game's grid asynchronously.