Experiment with targeted dropping
This commit is contained in:
parent
328459a5d6
commit
3ee5ae3d8f
1 changed files with 18 additions and 2 deletions
20
island.ts
20
island.ts
|
@ -166,9 +166,25 @@ export function IslandApplet() {
|
|||
function tick() {
|
||||
const islandTiles = islands.floodSearch(basePos, (tile) => tile > 0);
|
||||
dropWithin(islandTiles);
|
||||
dropWithin(islandTiles);
|
||||
|
||||
const mountainTiles = islands.floodSearch(basePos - 8, (tile) => tile > 4);
|
||||
// focus shore
|
||||
dropWithin(islandTiles.filter((pos) => islands.data[pos] == 0));
|
||||
|
||||
// form forest
|
||||
const hill = islands
|
||||
.floodSearch(basePos + 12, (tile) => tile >= 2)
|
||||
.filter((pos) => islands.data[pos] == 2);
|
||||
dropWithin(hill);
|
||||
|
||||
// grow forest
|
||||
const forestTiles = islandTiles.filter(
|
||||
(pos) => islands.data[pos] >= 2 && islands.data[pos] <= 3
|
||||
);
|
||||
dropWithin(forestTiles);
|
||||
dropWithin(forestTiles);
|
||||
|
||||
// form mountain
|
||||
const mountainTiles = islands.floodSearch(basePos - 12, (tile) => tile > 4);
|
||||
dropWithin(mountainTiles);
|
||||
|
||||
// const erodePos = islandTiles[islands.rng() % islandTiles.length];
|
||||
|
|
Loading…
Add table
Reference in a new issue