mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v1.22.31
This commit is contained in:
parent
f684996f82
commit
bc6b8cdafe
18 changed files with 111 additions and 111 deletions
|
|
@ -293,7 +293,7 @@
|
|||
// find start and end points
|
||||
const startX = getPointInRange(rangeX, graphWidth);
|
||||
const startY = getPointInRange(rangeY, graphHeight);
|
||||
|
||||
|
||||
let dist = 0, limit = 0, endX, endY;
|
||||
do {
|
||||
endX = Math.random() * graphWidth * .8 + graphWidth * .1;
|
||||
|
|
@ -382,7 +382,7 @@
|
|||
limit++;
|
||||
} while ((dist < graphWidth / 8 || dist > graphWidth / 2) && limit < 50)
|
||||
|
||||
let range = getRange(start, findGridCell(endX, endY));
|
||||
let range = getRange(start, findGridCell(endX, endY));
|
||||
|
||||
// get main ridge
|
||||
function getRange(cur, end) {
|
||||
|
|
@ -452,7 +452,7 @@
|
|||
|
||||
function getRange(cur, end) {
|
||||
const range = [];
|
||||
|
||||
|
||||
while (cur !== end) {
|
||||
let min = Infinity;
|
||||
cells.c[cur].forEach(function(e) {
|
||||
|
|
@ -465,7 +465,7 @@
|
|||
|
||||
return range;
|
||||
}
|
||||
|
||||
|
||||
const step = .1 / width;
|
||||
|
||||
while (width > 0) {
|
||||
|
|
@ -512,7 +512,7 @@
|
|||
const max = range.split("-")[1]/100 || 100;
|
||||
return rand(min * length, max * length);
|
||||
}
|
||||
|
||||
|
||||
return {generate, addHill, addRange, addTrough, addStrait, addPit, smooth, modify};
|
||||
|
||||
})));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue