mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 10:31:24 +01:00
feat: drawFeatures
This commit is contained in:
parent
6d9c86ba74
commit
4b071730f7
16 changed files with 233 additions and 416 deletions
|
|
@ -8,6 +8,7 @@ window.Rivers = (function () {
|
|||
|
||||
const riversData = {}; // rivers data
|
||||
const riverParents = {};
|
||||
|
||||
const addCellToRiver = function (cell, river) {
|
||||
if (!riversData[river]) riversData[river] = [cell];
|
||||
else riversData[river].push(cell);
|
||||
|
|
@ -19,7 +20,7 @@ window.Rivers = (function () {
|
|||
let riverNext = 1; // first river id is 1
|
||||
|
||||
const h = alterHeights();
|
||||
Lakes.prepareLakeData(h);
|
||||
Lakes.detectCloseLakes(h);
|
||||
resolveDepressions(h);
|
||||
drainWater();
|
||||
defineRivers();
|
||||
|
|
@ -39,9 +40,8 @@ window.Rivers = (function () {
|
|||
const cellsNumberModifier = (pointsInput.dataset.cells / 10000) ** 0.25;
|
||||
|
||||
const prec = grid.cells.prec;
|
||||
const area = pack.cells.area;
|
||||
const land = cells.i.filter(i => h[i] >= 20).sort((a, b) => h[b] - h[a]);
|
||||
const lakeOutCells = Lakes.setClimateData(h);
|
||||
const lakeOutCells = Lakes.defineClimateData(h);
|
||||
|
||||
land.forEach(function (i) {
|
||||
cells.fl[i] += prec[cells.g[i]] / cellsNumberModifier; // add flux from precipitation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue