|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.jgamegrid.GGMaze
public class GGMaze
This class creates a random maze in a two-dimensional grid of cells.
The maze has one entry and one exit cell and one pass (no cycles).
For details about the algorithm used to create the maze, please consult the
book 'Creating Mobile Games' by Carol Hamer, from where the code is
copied with acknowledgment to the autor.
Constructor Summary | |
---|---|
GGMaze(int width,
int height)
Creates a new random maze with given number of horizontal an vertical cells. |
Method Summary | |
---|---|
Location |
getExitLocation()
Returns the location of the exit cell. |
Location |
getStartLocation()
Returns the location of the entry cell. |
boolean |
isWall(Location location)
Returns true, if the cell with given cell location is a wall |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GGMaze(int width, int height)
width
- the number of horizontal cells (must be odd)height
- the number of vertical cells (must be odd)Method Detail |
---|
public Location getStartLocation()
public Location getExitLocation()
public boolean isWall(Location location)
location
- the location of the requested cell
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |