|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.dungeon.AbstractLevelGenerator wyvern.kernel.dungeon.MazeGenerator
This program creates a traditional maze to specs. There is only one path which leads from the entrance to the exit. A possible add-on for later: a "damage chance" which determines the likelihood that there are missing walls. These would allow for multiple correct paths and otherwise make navigating the maze easier. If we program it to draw rubble there, it'll even be obvious that it wasn't part of the original design. The symbols used are: # A wall. If blue, an illusionary wall. + A secret door. . Open square. Part of a tunnel. < The stairwell up to the previous level. > The stairwell down to the next level.
Field Summary | |
static int |
DEFAULT_DEVIATION
|
static int |
DEFAULT_DIFFICULTY
|
static java.lang.String |
DEFAULT_MAZE_FLOOR
|
static int |
DEFAULT_MAZE_HEIGHT
|
static java.lang.String |
DEFAULT_MAZE_WALL
|
static int |
DEFAULT_MAZE_WIDTH
|
static int |
DEFAULT_PHASE_CHANCE
|
static int |
DEFAULT_SECRET_CHANCE
|
protected java.lang.String |
wall_
|
Fields inherited from class wyvern.kernel.dungeon.AbstractLevelGenerator |
DEFAULT_HEIGHT, DEFAULT_WIDTH, floor_, height_, oobTerrain_, stairsDown_, stairsUp_, terrain_, width_ |
Constructor Summary | |
MazeGenerator()
|
Method Summary | |
GameMap |
generate(java.lang.Class mapclass)
Generates a new maze. |
int |
getDeviation()
|
int |
getDifficulty()
|
int |
getPhaseChance()
|
int |
getSecretChance()
|
java.lang.String |
getWallArchetype()
|
static void |
main(java.lang.String[] argv)
|
void |
setDeviation(int deviation)
The percent chance that the tunnel will choose a random direction instead of continuing in the same direction. |
void |
setDifficulty(int difficulty)
This value determines how far away from the entrance the exit will lie. |
void |
setHeight(int height)
Sets the height to use next time a maze is generated. |
void |
setPhaseChance(int chance)
The odds (of 1000) that a given corridor ends in a "phase wall"- a barrier that appears and disappears at random but which otherwise appears to be a normal wall. |
void |
setSecretChance(int chance)
The odds (of 1000) that a given corridor ends in a "false wall" (a secret door). |
void |
setWallArchetype(java.lang.String arch)
Archetype to use for the walls between corridors. |
void |
setWidth(int width)
Sets the width to use next time a maze is generated. |
Methods inherited from class wyvern.kernel.dungeon.AbstractLevelGenerator |
getDefaultTerrain, getDownstairArchetype, getFloorArchetype, getHeight, getOOBTerrain, getUpstairArchetype, getWidth, instantiateFloor, instantiateObject, rand, setDefaultTerrain, setDownstairArchetype, setFloorArchetype, setOOBTerrain, setUpstairArchetype |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_MAZE_WIDTH
public static final int DEFAULT_MAZE_HEIGHT
public static final java.lang.String DEFAULT_MAZE_FLOOR
public static final java.lang.String DEFAULT_MAZE_WALL
public static final int DEFAULT_DIFFICULTY
public static final int DEFAULT_DEVIATION
public static final int DEFAULT_SECRET_CHANCE
public static final int DEFAULT_PHASE_CHANCE
protected java.lang.String wall_
Constructor Detail |
public MazeGenerator()
Method Detail |
public void setDifficulty(int difficulty)
difficulty
- 1-100public int getDifficulty()
public void setDeviation(int deviation)
deviation
- 0-100public int getDeviation()
public void setPhaseChance(int chance)
chance
- 0-1000public int getPhaseChance()
public void setSecretChance(int chance)
chance
- 0-1000public int getSecretChance()
public void setWallArchetype(java.lang.String arch)
arch
- the arch local path, e.g "walls/house_wall".public java.lang.String getWallArchetype()
public void setWidth(int width)
setWidth
in class AbstractLevelGenerator
width
- the new width; must be ODD.
java.lang.IllegalArgumentException
- if width is even or negativepublic void setHeight(int height)
setHeight
in class AbstractLevelGenerator
height
- the new height; must be ODD.
java.lang.IllegalArgumentException
- if height is even or negativepublic GameMap generate(java.lang.Class mapclass) throws java.lang.Exception
generate
in class AbstractLevelGenerator
mapclass
- the class to instantiate
java.lang.Exception
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |