mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
refactor(generation): cultures start
This commit is contained in:
parent
1a57a8ac08
commit
fe20f66b96
15 changed files with 621 additions and 581 deletions
|
|
@ -49,7 +49,7 @@ window.BurgsAndStates = (function () {
|
|||
let burgs = [0];
|
||||
|
||||
const rand = () => 0.5 + Math.random() * 0.5;
|
||||
const score = new Int16Array(cells.s.map(s => s * rand())); // cell score for capitals placement
|
||||
const score = new Int16Array(cells.s.map(s => s * Math.random())); // cell score for capitals placement
|
||||
const sorted = cells.i.filter(i => score[i] > 0 && cells.culture[i]).sort((a, b) => score[b] - score[a]); // filtered and sorted array of indexes
|
||||
|
||||
if (sorted.length < count * 10) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue