new RougeLikeMap(width, height, x, y)
an object representing the map data itself
1: a map consists of multiple things, A a 2d array of tiles ie: the literal map data.
2: the region data, ie: the subdivisions of the bulk space via the tree splitting algorithm
3: RougeLikePoints of interest
4: an array of events on the map
Parameters:
Name | Type | Default | Description |
---|---|---|---|
width |
number | 100 | INTEGER the width of the map to be generated |
height |
number | 100 | INTEGER the width of the map to be generated |
x |
number | 0 | (OPTIONAL) x coordinate of the upper left corner |
y |
number | 0 | (OPTIONAL) y coordinate of the upper left corner |
Members
-
height
-
the width of the map to be generated
-
mapId
-
the id of the map as it relates to mod saved data, not game data
-
mapTiles :Array.<Tile>
-
a 1d array of tile objects that represents the map assume y increases by 1 every maxX x
-
regions :Array.<Region>
-
an array of all regions
-
rooms :Region
-
an array of just leafs
-
rootRegion :Region
-
the root of the region
-
upperLeftX
-
x coordinate of the upper left corner
-
upperLeftY
-
y coordinate of the upper left corner
-
width
-
the width of the map to be generated
Methods
-
makeBlankTileSet()
-
set the array to the correct length of empty tiles
-
pushToDataMap()
-
push the map data from this class to the data map
-
setTile(x, y, tile)
-
set a tile in the array based on x,y pair
Parameters:
Name Type Description x
number x cord
y
number y cord
tile
Tile tile obj
-
updateRegions()
-
traverse from root region updating the list of regions
-
updateTiles()
-
rebuild mapTiles