Class ROT.Map.Cellular
Extends
ROT.Map.
Cellular automaton map generator
Defined in: <rot.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
ROT.Map.Cellular(width, height, options)
|
Method Attributes | Method Name and Description |
---|---|
create(callback)
|
|
randomize(probability)
Fill the map with random values
|
|
set(x, y, value)
|
Class Detail
ROT.Map.Cellular(width, height, options)
- Parameters:
- {int} width Optional, Default: ROT.DEFAULT_WIDTH
- {int} height Optional, Default: ROT.DEFAULT_HEIGHT
- {object} options Optional
- Options
- {int[]} options.born Optional
- List of neighbor counts for a new cell to be born in empty space
- {int[]} options.survive Optional
- List of neighbor counts for an existing cell to survive
- {int} options.topology Optional
- Topology 4 or 6 or 8
Method Detail
create(callback)
- Parameters:
- callback
randomize(probability)
Fill the map with random values
- Parameters:
- {float} probability
- Probability for a cell to become alive; 0 = all empty, 1 = all full
set(x, y, value)
- Parameters:
- x
- y
- value