![]() |
Adventure at Umalu
22nd March, 2013
Rogue-like Dungeon Crawler, written in Java
|
Public Member Functions | |
Cellular () | |
Cellular (ColoredChar floor, ColoredChar wall) | |
Cellular (ColoredChar floor, ColoredChar wall, int wallChance, int minCount, int maxCount) | |
Protected Member Functions | |
void | generateStep (World world, Dice dice) |
Uses cellular automaton to generate interesting cave-like maps. This implementation always tries to make a connected map. For large maps, this is usually done by removing small unconnected portions of the map. For small maps, the whole map is usually scrapped and a new map generated. Since the map is small, this turns out to be fairly inexpensive. However, after 100 tries, the algorithm quits, most likely leaving a completely impassible
. This all but guaranteed on exceptionally small maps.
jade.gen.map.Cellular.Cellular | ( | ) |
Creates a new instance of
with the default open tile of '.' and a default closed tile of '#'.
jade.gen.map.Cellular.Cellular | ( | ColoredChar | floor, |
ColoredChar | wall | ||
) |
Creates a new instance of
with the specified open and closed tiles.
floor | the face of the open tiles |
wall | the face of the closed tiles |
jade.gen.map.Cellular.Cellular | ( | ColoredChar | floor, |
ColoredChar | wall, | ||
int | wallChance, | ||
int | minCount, | ||
int | maxCount | ||
) |
Creates a new instance of Cellular with the specified generation parameters. Great care should be taken when customizing these parameters, as certain configurations may make it impossible to generate good levels.
floor | the face of the open tiles |
wall | the face of the closed tiles |
wallChance | the chance out of 100 of seeding the map with a wall, as well as the required percent of wall tiles for the map to be accepted |
minCount | the minimum number of walls at distance 1 to generate a wall |
maxCount | the maximum number of walls at distance 2 to generate a wall |