|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJTP.Challenge
public class Challenge
Generates levels for one and two-player challenge modes.
Constructor Summary | |
---|---|
Challenge()
|
Method Summary | |
---|---|
static Level |
genLevel(Dimension grid,
Point offset,
int tileCount,
int maxTileHeight,
boolean cooperative,
Random r)
Generates a new level with the given attributes. |
static LevelSet |
genSet(int numberOfLevels,
int minTileCount,
int minTileCountIncrement,
Dimension grid,
Point offset,
int maxTileHeight,
int forceGenRetries,
boolean cooperative)
Generates a new set of levels with the given attributes. |
static LevelSet |
genSet(int numberOfLevels,
int minTileCount,
int minTileCountIncrement,
int gridSize,
int offset,
int maxTileHeight,
int forceGenRetries,
boolean cooperative)
Generates a new set of levels with the given attributes and a square grid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Challenge()
Method Detail |
---|
public static LevelSet genSet(int numberOfLevels, int minTileCount, int minTileCountIncrement, Dimension grid, Point offset, int maxTileHeight, int forceGenRetries, boolean cooperative) throws IllegalArgumentException
numberOfLevels
- the number of levels to generateminTileCount
- number of tiles required in first levelminTileCountIncrement
- increase of tiles per level. For example
level 10 would have minTileCount +
(minTileCountIncrement * 9)
tiles.grid
- width and height of all levelsoffset
- from outside of grid which is not to be used. For example
if the grid is 15x15 and the offset has been specified as 2x2 then only
the 11x11 area in the middle of the 15x15 grid will be usedmaxTileHeight
- maximum height of any pileforceGenRetries
- number of times to regenerate level if it does
not have enough tiles (this can happen if the current position is
surrounded by piles of height maxTileHeight
.cooperative
- if set, a two-player levelset will be generated
IllegalArgumentException
- if offset
is too large for
the specified grid
.public static LevelSet genSet(int numberOfLevels, int minTileCount, int minTileCountIncrement, int gridSize, int offset, int maxTileHeight, int forceGenRetries, boolean cooperative)
numberOfLevels
- the number of levels to generateminTileCount
- number of tiles required in first levelminTileCountIncrement
- increase of tiles per level. For example
level 10 would have minTileCount +
(minTileCountIncrement * 9)
tiles.gridSize
- width and height of all levelsoffset
- from outside of grid which is not to be used. For example
if the grid is 15x15 and the offset has been specified as 2 then only
the 11x11 area in the middle of the 15x15 grid will be usedmaxTileHeight
- maximum height of any pileforceGenRetries
- number of times to regenerate level if it does
not have enough tiles (this can happen if the current position is
surrounded by piles of height maxTileHeight
.cooperative
- if set, a two-player levelset will be generated
IllegalArgumentException
- if offset
is too large for
the specified grid
.public static Level genLevel(Dimension grid, Point offset, int tileCount, int maxTileHeight, boolean cooperative, Random r)
grid
- width and height of the leveloffset
- from outside of grid which is not to be used. For example
if the grid is 15x15 and the offset has been specified as 2 then only
the 11x11 area in the middle of the 15x15 grid will be usedtileCount
- number of tiles the level should have. Note: The level
can end up with less than the specified number of tiles. This is not
very likely though, unless tileCount
is very large and
and maxTileHeight
fairly low.maxTileHeight
- maximum height of any pilecooperative
- if set, a two-player level will be generatedr
- instance of Random
required to use
Random.nextGaussian()
method
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |