mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-23 20:41:23 +01:00
Update main.js
This commit is contained in:
parent
a75ef6d05b
commit
1e610b5f7d
1 changed files with 4 additions and 4 deletions
8
main.js
8
main.js
|
|
@ -1180,7 +1180,7 @@ function reGraph() {
|
||||||
TIME && console.timeEnd("reGraph");
|
TIME && console.timeEnd("reGraph");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detect and draw the coasline
|
// Detect and draw the coastline
|
||||||
function drawCoastline() {
|
function drawCoastline() {
|
||||||
TIME && console.time("drawCoastline");
|
TIME && console.time("drawCoastline");
|
||||||
reMarkFeatures();
|
reMarkFeatures();
|
||||||
|
|
@ -1408,8 +1408,8 @@ function defineBiomes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculateMoisture(i) {
|
function calculateMoisture(i) {
|
||||||
let moist = prec[cells.g[i]];
|
let moist = prec[cells.g[i]]; //moist equal to prec in this grid cell
|
||||||
if (cells.r[i]) moist += Math.max(cells.fl[i] / 20, 2);
|
if (cells.r[i]) moist += Math.max(cells.fl[i] / 20, 2); //if there is a river, add local flux / 20 (but at least 2) to the moist value
|
||||||
|
|
||||||
const n = cells.c[i]
|
const n = cells.c[i]
|
||||||
.filter(isLand)
|
.filter(isLand)
|
||||||
|
|
@ -1425,7 +1425,7 @@ function defineBiomes() {
|
||||||
function getBiomeId(moisture, temperature, height) {
|
function getBiomeId(moisture, temperature, height) {
|
||||||
if (height < 20) return 0; // marine biome: all water cells
|
if (height < 20) return 0; // marine biome: all water cells
|
||||||
if (temperature < -5) return 11; // permafrost biome
|
if (temperature < -5) return 11; // permafrost biome
|
||||||
if (moisture > 40 && temperature > -2 && (height < 25 || (moisture > 24 && height > 24 && height < 60))) return 12; // wetland biome
|
if (moisture > 40 && temperature > -2 && height < 60); // wetland biome
|
||||||
|
|
||||||
const moistureBand = Math.min((moisture / 5) | 0, 4); // [0-4]
|
const moistureBand = Math.min((moisture / 5) | 0, 4); // [0-4]
|
||||||
const temperatureBand = Math.min(Math.max(20 - temperature, 0), 25); // [0-25]
|
const temperatureBand = Math.min(Math.max(20 - temperature, 0), 25); // [0-25]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue