public class WobblyLine extends Object
Constructor and Description |
---|
WobblyLine() |
Modifier and Type | Method and Description |
---|---|
static List<Coord> |
line(Coord start,
Coord end,
int width,
int height)
Draws a line from start to end using the Drunkard's Walk algorithm.
|
static List<Coord> |
line(int startX,
int startY,
int endX,
int endY,
int width,
int height)
Draws a line from (startX, startY) to (endX, endY) using the Drunkard's Walk algorithm.
|
static List<Coord> |
line(int startX,
int startY,
int endX,
int endY,
int width,
int height,
double weight,
RNG rng)
Draws a line from (startX, startY) to (endX, endY) using the Drunkard's Walk algorithm.
|
public WobblyLine()
public static List<Coord> line(int startX, int startY, int endX, int endY, int width, int height)
line(startX, startY, endX, endY, width, height, 0.75, new RNG())
.startX
- x of starting pointstartY
- y of starting pointendX
- x of ending pointendY
- y of ending pointwidth
- maximum map widthheight
- maximum map heightpublic static List<Coord> line(int startX, int startY, int endX, int endY, int width, int height, double weight, RNG rng)
startX
- x of starting pointstartY
- y of starting pointendX
- x of ending pointendY
- y of ending pointwidth
- maximum map widthheight
- maximum map heightweight
- between 0.5 and 1.0, usually. 0.6 makes very random walks, 0.9 is almost a straight line.rng
- the random number generator to usepublic static List<Coord> line(Coord start, Coord end, int width, int height)
start
- starting pointend
- ending pointwidth
- maximum map widthheight
- maximum map heightCopyright © 2012–2016. All rights reserved.