mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 20:11:24 +01:00
alternative grid generators
This commit is contained in:
parent
8735ca8a3e
commit
3827a50bee
3 changed files with 70 additions and 8 deletions
4
main.js
4
main.js
|
|
@ -642,8 +642,10 @@ async function generate(options) {
|
|||
|
||||
applyMapSize();
|
||||
randomizeOptions();
|
||||
const method = window[document.getElementById('gridAlgorithm').value];
|
||||
console.log('gird generation method', method);
|
||||
|
||||
if (shouldRegenerateGrid(grid)) grid = precreatedGraph || generateGrid();
|
||||
if (shouldRegenerateGrid(grid, method)) grid = precreatedGraph || generateGrid(method);
|
||||
else delete grid.cells.h;
|
||||
grid.cells.h = await HeightmapGenerator.generate(grid);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue