Class Index | File Index

Classes


Class ROT.Map.Cellular


Extends ROT.Map.
Cellular automaton map generator
Defined in: <rot.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
ROT.Map.Cellular(width, height, options)
Method Summary
Method Attributes Method Name and Description
 
connect(callback, value, callback)
Make sure every non-wall space is accessible.
 
create(callback)
 
randomize(probability)
Fill the map with random values
 
serviceCallback(callback)
 
set(x, y, value)
 
setOptions(options)
Change options.
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
connect(callback, value, callback)
Make sure every non-wall space is accessible.
Parameters:
{function} callback
to call to display map when do
{int} value
to consider empty space - defaults to 0
{function} callback
to call when a new connection is made

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

serviceCallback(callback)
Parameters:
callback

set(x, y, value)
Parameters:
x
y
value

setOptions(options)
Change options.
Parameters:
options
See:
ROT.Map.Cellular

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jun 13 2016 11:14:41 GMT+0200 (CEST)